Files

53 lines
1.5 KiB
C++

// Copyright Daniel Wallin, David Abrahams 2010.
// 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_IS_MAYBE_050329_HPP
#define ACTIV_BOOST_PARAMETER_IS_MAYBE_050329_HPP
namespace Boost { namespace parameter { namespace aux {
struct maybe_base
{
};
}}} // namespace Boost::parameter::aux
#if defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11)
#include <type_traits>
namespace Boost { namespace parameter { namespace aux {
template <typename T>
using is_maybe = ::std::is_base_of<
::Boost::parameter::aux::maybe_base
, typename ::std::remove_const<T>::type
>;
}}} // namespace Boost::parameter::aux
#else // !defined(ACTIV_BOOST_PARAMETER_CAN_USE_MP11)
#include <ActivBoost/mpl/bool.hpp>
#include <ActivBoost/mpl/if.hpp>
#include <ActivBoost/type_traits/is_base_of.hpp>
#include <ActivBoost/type_traits/remove_const.hpp>
namespace Boost { namespace parameter { namespace aux {
template <typename T>
struct is_maybe
: ::Boost::mpl::if_<
::Boost::is_base_of<
::Boost::parameter::aux::maybe_base
, typename ::Boost::remove_const<T>::type
>
, ::Boost::mpl::true_
, ::Boost::mpl::false_
>::type
{
};
}}} // namespace Boost::parameter::aux
#endif // ACTIV_BOOST_PARAMETER_CAN_USE_MP11
#endif // include guard