From 8c1bf76842163637a408764dc4b54bd0a5bc3aaf Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Thu, 28 Nov 2002 06:59:11 +0000 Subject: [PATCH] add 'is_placeholder' [SVN r16451] --- include/boost/mpl/is_placeholder.hpp | 64 ++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 include/boost/mpl/is_placeholder.hpp diff --git a/include/boost/mpl/is_placeholder.hpp b/include/boost/mpl/is_placeholder.hpp new file mode 100644 index 0000000..908ab50 --- /dev/null +++ b/include/boost/mpl/is_placeholder.hpp @@ -0,0 +1,64 @@ +//----------------------------------------------------------------------------- +// boost mpl/is_placeholder.hpp header file +// See http://www.boost.org for updates, documentation, and revision history. +//----------------------------------------------------------------------------- +// +// Copyright (c) 2001-02 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. + +#ifndef BOOST_MPL_IS_PLACEHOLDER_HPP_INCLUDED +#define BOOST_MPL_IS_PLACEHOLDER_HPP_INCLUDED + +#include "boost/mpl/arg_fwd.hpp" +#include "boost/mpl/bool_c.hpp" +#include "boost/mpl/aux_/yes_no.hpp" +#include "boost/mpl/aux_/config/ctps.hpp" + +namespace boost { namespace mpl { + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +template< typename T > +struct is_placeholder + : bool_c +{ +}; + +template< int N > +struct is_placeholder< arg > + : bool_c +{ +}; + +#else + +namespace aux { + +aux::no_tag is_placeholder_helper(...); + +template< int N > +aux::yes_tag is_placeholder_helper(arg*); + +} // namespace aux + +template< typename T > +struct is_placeholder +{ + BOOST_STATIC_CONSTANT(bool, value = + sizeof(aux::is_placeholder_helper(static_cast(0))) == sizeof(aux::yes_tag) + ); +}; + +#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +}} // namespace boost::mpl + +#endif // BOOST_MPL_IS_PLACEHOLDER_HPP_INCLUDED