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