1// Copyright Daniel Wallin, David Abrahams 2005.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at
4// http://www.boost.org/LICENSE_1_0.txt)
5
6#ifndef BOOST_PARAMETER_AUX_YESNO_HPP
7#define BOOST_PARAMETER_AUX_YESNO_HPP
8
9namespace boost { namespace parameter { namespace aux {
10
11 // types used with the "sizeof trick" to capture the results of
12 // overload resolution at compile-time.
13 typedef char yes_tag;
14 typedef char (&no_tag)[2];
15}}} // namespace boost::parameter::aux
16
17#include <boost/mpl/bool.hpp>
18
19namespace boost { namespace parameter { namespace aux {
20
21 // mpl::true_ and mpl::false_ are not distinguishable by sizeof(),
22 // so we pass them through these functions to get a type that is.
23 ::boost::parameter::aux::yes_tag to_yesno(::boost::mpl::true_);
24 ::boost::parameter::aux::no_tag to_yesno(::boost::mpl::false_);
25}}} // namespace boost::parameter::aux
26
27#include <boost/parameter/config.hpp>
28
29#if defined(BOOST_PARAMETER_CAN_USE_MP11)
30#include <boost/mp11/integral.hpp>
31
32namespace boost { namespace parameter { namespace aux {
33
34 // mp11::mp_true and mp11::mp_false are not distinguishable by sizeof(),
35 // so we pass them through these functions to get a type that is.
36 ::boost::parameter::aux::yes_tag to_yesno(::boost::mp11::mp_true);
37 ::boost::parameter::aux::no_tag to_yesno(::boost::mp11::mp_false);
38}}} // namespace boost::parameter::aux
39
40#endif // BOOST_PARAMETER_CAN_USE_MP11
41#endif // include guard
42
43

source code of include/boost/parameter/aux_/yesno.hpp