Chris@16
|
1
|
Chris@16
|
2 #ifndef BOOST_MPL_AUX_NA_HPP_INCLUDED
|
Chris@16
|
3 #define BOOST_MPL_AUX_NA_HPP_INCLUDED
|
Chris@16
|
4
|
Chris@16
|
5 // Copyright Aleksey Gurtovoy 2001-2004
|
Chris@16
|
6 //
|
Chris@16
|
7 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
8 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
9 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
10 //
|
Chris@16
|
11 // See http://www.boost.org/libs/mpl for documentation.
|
Chris@16
|
12
|
Chris@101
|
13 // $Id$
|
Chris@101
|
14 // $Date$
|
Chris@101
|
15 // $Revision$
|
Chris@16
|
16
|
Chris@16
|
17 #include <boost/mpl/bool.hpp>
|
Chris@16
|
18 #include <boost/mpl/aux_/na_fwd.hpp>
|
Chris@16
|
19 #include <boost/mpl/aux_/config/msvc.hpp>
|
Chris@16
|
20 #include <boost/mpl/aux_/config/ctps.hpp>
|
Chris@16
|
21
|
Chris@16
|
22 namespace boost { namespace mpl {
|
Chris@16
|
23
|
Chris@16
|
24 template< typename T >
|
Chris@16
|
25 struct is_na
|
Chris@16
|
26 : false_
|
Chris@16
|
27 {
|
Chris@16
|
28 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
Chris@16
|
29 using false_::value;
|
Chris@16
|
30 #endif
|
Chris@16
|
31 };
|
Chris@16
|
32
|
Chris@16
|
33 template<>
|
Chris@16
|
34 struct is_na<na>
|
Chris@16
|
35 : true_
|
Chris@16
|
36 {
|
Chris@16
|
37 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
Chris@16
|
38 using true_::value;
|
Chris@16
|
39 #endif
|
Chris@16
|
40 };
|
Chris@16
|
41
|
Chris@16
|
42 template< typename T >
|
Chris@16
|
43 struct is_not_na
|
Chris@16
|
44 : true_
|
Chris@16
|
45 {
|
Chris@16
|
46 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
Chris@16
|
47 using true_::value;
|
Chris@16
|
48 #endif
|
Chris@16
|
49 };
|
Chris@16
|
50
|
Chris@16
|
51 template<>
|
Chris@16
|
52 struct is_not_na<na>
|
Chris@16
|
53 : false_
|
Chris@16
|
54 {
|
Chris@16
|
55 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
Chris@16
|
56 using false_::value;
|
Chris@16
|
57 #endif
|
Chris@16
|
58 };
|
Chris@16
|
59
|
Chris@16
|
60 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
Chris@16
|
61 template< typename T, typename U > struct if_na
|
Chris@16
|
62 {
|
Chris@16
|
63 typedef T type;
|
Chris@16
|
64 };
|
Chris@16
|
65
|
Chris@16
|
66 template< typename U > struct if_na<na,U>
|
Chris@16
|
67 {
|
Chris@16
|
68 typedef U type;
|
Chris@16
|
69 };
|
Chris@16
|
70 #else
|
Chris@16
|
71 template< typename T > struct if_na_impl
|
Chris@16
|
72 {
|
Chris@16
|
73 template< typename U > struct apply
|
Chris@16
|
74 {
|
Chris@16
|
75 typedef T type;
|
Chris@16
|
76 };
|
Chris@16
|
77 };
|
Chris@16
|
78
|
Chris@16
|
79 template<> struct if_na_impl<na>
|
Chris@16
|
80 {
|
Chris@16
|
81 template< typename U > struct apply
|
Chris@16
|
82 {
|
Chris@16
|
83 typedef U type;
|
Chris@16
|
84 };
|
Chris@16
|
85 };
|
Chris@16
|
86
|
Chris@16
|
87 template< typename T, typename U > struct if_na
|
Chris@16
|
88 : if_na_impl<T>::template apply<U>
|
Chris@16
|
89 {
|
Chris@16
|
90 };
|
Chris@16
|
91 #endif
|
Chris@16
|
92
|
Chris@16
|
93 }}
|
Chris@16
|
94
|
Chris@16
|
95 #endif // BOOST_MPL_AUX_NA_HPP_INCLUDED
|