43 lines
1.5 KiB
C++
43 lines
1.5 KiB
C++
// Copyright Daniel Wallin, David Abrahams 2005.
|
|
// 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)
|
|
|
|
#ifndef ACTIV_BOOST_PARAMETER_AUX_YESNO_HPP
|
|
#define ACTIV_BOOST_PARAMETER_AUX_YESNO_HPP
|
|
|
|
namespace Boost { namespace parameter { namespace aux {
|
|
|
|
// types used with the "sizeof trick" to capture the results of
|
|
// overload resolution at compile-time.
|
|
typedef char yes_tag;
|
|
typedef char (&no_tag)[2];
|
|
}}} // namespace Boost::parameter::aux
|
|
|
|
#include <ActivBoost/mpl/bool.hpp>
|
|
|
|
namespace Boost { namespace parameter { namespace aux {
|
|
|
|
// mpl::true_ and mpl::false_ are not distinguishable by sizeof(),
|
|
// so we pass them through these functions to get a type that is.
|
|
::Boost::parameter::aux::yes_tag to_yesno(::Boost::mpl::true_);
|
|
::Boost::parameter::aux::no_tag to_yesno(::Boost::mpl::false_);
|
|
}}} // namespace Boost::parameter::aux
|
|
|
|
#include <ActivBoost/parameter/config.hpp>
|
|
|
|
#if defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11)
|
|
#include <ActivBoost/mp11/integral.hpp>
|
|
|
|
namespace Boost { namespace parameter { namespace aux {
|
|
|
|
// mp11::mp_true and mp11::mp_false are not distinguishable by sizeof(),
|
|
// so we pass them through these functions to get a type that is.
|
|
::Boost::parameter::aux::yes_tag to_yesno(::Boost::mp11::mp_true);
|
|
::Boost::parameter::aux::no_tag to_yesno(::Boost::mp11::mp_false);
|
|
}}} // namespace Boost::parameter::aux
|
|
|
|
#endif // ACTIV_BOOST_PARAMETER_CAN_USE_MP11
|
|
#endif // include guard
|
|
|