1
0
forked from boostorg/mpl
Files

77 lines
1.6 KiB
C++
Raw Permalink Normal View History

2002-09-15 22:13:24 +00:00
#ifndef BOOST_MPL_VOID_HPP_INCLUDED
#define BOOST_MPL_VOID_HPP_INCLUDED
2004-09-02 15:41:37 +00:00
// Copyright Aleksey Gurtovoy 2001-2004
2003-05-08 09:43:23 +00:00
//
2004-09-02 15:41:37 +00:00
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
2003-05-08 09:43:23 +00:00
//
// See http://www.boost.org/libs/mpl for documentation.
2008-10-10 09:10:26 +00:00
// $Id$
2004-09-02 15:41:37 +00:00
// $Date$
// $Revision$
2002-10-07 11:32:25 +00:00
2004-09-02 15:41:37 +00:00
#include <boost/mpl/void_fwd.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/config/msvc.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
2002-09-15 22:13:24 +00:00
2003-02-04 04:45:22 +00:00
// [JDG Feb-4-2003] made void_ a complete type to allow it to be
// instantiated so that it can be passed in as an object that can be
// used to select an overloaded function. Possible use includes signaling
// a zero arity functor evaluation call.
2003-05-03 11:13:11 +00:00
struct void_ { typedef void_ type; };
2002-09-15 22:13:24 +00:00
2004-09-02 15:41:37 +00:00
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
namespace boost { namespace mpl {
2002-10-07 11:32:25 +00:00
template< typename T >
struct is_void_
2003-02-25 23:11:41 +00:00
: false_
2002-10-07 11:32:25 +00:00
{
2014-03-25 08:31:37 +00:00
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
using false_::value;
#endif
2002-10-07 11:32:25 +00:00
};
2002-09-15 22:13:24 +00:00
2002-10-07 11:32:25 +00:00
template<>
struct is_void_<void_>
2003-02-25 23:11:41 +00:00
: true_
2002-10-07 11:32:25 +00:00
{
2014-03-25 08:31:37 +00:00
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
using true_::value;
#endif
2002-10-07 11:32:25 +00:00
};
2002-09-15 22:13:24 +00:00
2004-09-02 15:41:37 +00:00
template< typename T >
struct is_not_void_
: true_
{
2014-03-25 08:31:37 +00:00
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
using true_::value;
#endif
2004-09-02 15:41:37 +00:00
};
template<>
struct is_not_void_<void_>
: false_
{
2014-03-25 08:31:37 +00:00
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
using false_::value;
#endif
2004-09-02 15:41:37 +00:00
};
BOOST_MPL_AUX_NA_SPEC(1, is_void_)
BOOST_MPL_AUX_NA_SPEC(1, is_not_void_)
}}
2002-09-15 22:13:24 +00:00
#endif // BOOST_MPL_VOID_HPP_INCLUDED