]> git.lyx.org Git - lyx.git/blob - boost/boost/mpl/aux_/yes_no.hpp
b9a1bceed48e58ec937a7c93f8f64888b9db14ad
[lyx.git] / boost / boost / mpl / aux_ / yes_no.hpp
1
2 #ifndef BOOST_MPL_AUX_YES_NO_HPP_INCLUDED
3 #define BOOST_MPL_AUX_YES_NO_HPP_INCLUDED
4
5 // + file: boost/mpl/aux_/yes_no.hpp
6 // + last modified: 05/nov/03
7
8 // Copyright Aleksey Gurtovoy 2000-03
9 //
10 // Use, modification and distribution are subject to the Boost Software 
11 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy 
12 // at http://www.boost.org/LICENSE_1_0.txt)
13 //
14 // See http://www.boost.org/libs/mpl for documentation.
15
16
17 #include "boost/mpl/aux_/config/workaround.hpp"
18 #include "boost/mpl/aux_/config/msvc.hpp"
19
20 namespace boost { namespace mpl { namespace aux {
21
22 typedef char (&no_tag)[1];
23 typedef char (&yes_tag)[2];
24
25 template< bool C_ > struct yes_no_tag
26 {
27     typedef no_tag type;
28 };
29
30 template<> struct yes_no_tag<true>
31 {
32     typedef yes_tag type;
33 };
34
35
36 template< long n > struct weighted_tag
37 {
38 #if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)
39     typedef char (&type)[n];
40 #else
41     char buf[n];
42     typedef weighted_tag type;
43 #endif
44 };
45
46 #if    BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
47     || BOOST_WORKAROUND(BOOST_MSVC, == 1300)
48 template<> struct weighted_tag<0>
49 {
50     typedef char (&type)[1];
51 };
52 #endif
53
54 }}} // namespace boost::mpl::aux 
55
56 #endif // BOOST_MPL_AUX_YES_NO_HPP_INCLUDED