author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
sl@0 | 1 |
|
sl@0 | 2 |
#ifndef BOOST_MPL_VOID_HPP_INCLUDED |
sl@0 | 3 |
#define BOOST_MPL_VOID_HPP_INCLUDED |
sl@0 | 4 |
|
sl@0 | 5 |
// Copyright Aleksey Gurtovoy 2001-2004 |
sl@0 | 6 |
// |
sl@0 | 7 |
// Distributed under the Boost Software License, Version 1.0. |
sl@0 | 8 |
// (See accompanying file LICENSE_1_0.txt or copy at |
sl@0 | 9 |
// http://www.boost.org/LICENSE_1_0.txt) |
sl@0 | 10 |
// |
sl@0 | 11 |
// See http://www.boost.org/libs/mpl for documentation. |
sl@0 | 12 |
|
sl@0 | 13 |
// $Source: /cvsroot/boost/boost/boost/mpl/void.hpp,v $ |
sl@0 | 14 |
// $Date: 2004/09/02 15:40:42 $ |
sl@0 | 15 |
// $Revision: 1.9 $ |
sl@0 | 16 |
|
sl@0 | 17 |
#include <boost/mpl/void_fwd.hpp> |
sl@0 | 18 |
#include <boost/mpl/bool.hpp> |
sl@0 | 19 |
#include <boost/mpl/aux_/na_spec.hpp> |
sl@0 | 20 |
#include <boost/mpl/aux_/config/msvc.hpp> |
sl@0 | 21 |
#include <boost/mpl/aux_/config/workaround.hpp> |
sl@0 | 22 |
|
sl@0 | 23 |
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN |
sl@0 | 24 |
|
sl@0 | 25 |
// [JDG Feb-4-2003] made void_ a complete type to allow it to be |
sl@0 | 26 |
// instantiated so that it can be passed in as an object that can be |
sl@0 | 27 |
// used to select an overloaded function. Possible use includes signaling |
sl@0 | 28 |
// a zero arity functor evaluation call. |
sl@0 | 29 |
struct void_ { typedef void_ type; }; |
sl@0 | 30 |
|
sl@0 | 31 |
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE |
sl@0 | 32 |
|
sl@0 | 33 |
namespace boost { namespace mpl { |
sl@0 | 34 |
|
sl@0 | 35 |
template< typename T > |
sl@0 | 36 |
struct is_void_ |
sl@0 | 37 |
: false_ |
sl@0 | 38 |
{ |
sl@0 | 39 |
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) |
sl@0 | 40 |
using false_::value; |
sl@0 | 41 |
#endif |
sl@0 | 42 |
}; |
sl@0 | 43 |
|
sl@0 | 44 |
template<> |
sl@0 | 45 |
struct is_void_<void_> |
sl@0 | 46 |
: true_ |
sl@0 | 47 |
{ |
sl@0 | 48 |
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) |
sl@0 | 49 |
using true_::value; |
sl@0 | 50 |
#endif |
sl@0 | 51 |
}; |
sl@0 | 52 |
|
sl@0 | 53 |
template< typename T > |
sl@0 | 54 |
struct is_not_void_ |
sl@0 | 55 |
: true_ |
sl@0 | 56 |
{ |
sl@0 | 57 |
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) |
sl@0 | 58 |
using true_::value; |
sl@0 | 59 |
#endif |
sl@0 | 60 |
}; |
sl@0 | 61 |
|
sl@0 | 62 |
template<> |
sl@0 | 63 |
struct is_not_void_<void_> |
sl@0 | 64 |
: false_ |
sl@0 | 65 |
{ |
sl@0 | 66 |
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) |
sl@0 | 67 |
using false_::value; |
sl@0 | 68 |
#endif |
sl@0 | 69 |
}; |
sl@0 | 70 |
|
sl@0 | 71 |
BOOST_MPL_AUX_NA_SPEC(1, is_void_) |
sl@0 | 72 |
BOOST_MPL_AUX_NA_SPEC(1, is_not_void_) |
sl@0 | 73 |
|
sl@0 | 74 |
}} |
sl@0 | 75 |
|
sl@0 | 76 |
#endif // BOOST_MPL_VOID_HPP_INCLUDED |