1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/variant/static_visitor.hpp Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,97 @@
1.4 +//-----------------------------------------------------------------------------
1.5 +// boost variant/static_visitor.hpp header file
1.6 +// See http://www.boost.org for updates, documentation, and revision history.
1.7 +//-----------------------------------------------------------------------------
1.8 +//
1.9 +// Copyright (c) 2002-2003
1.10 +// Eric Friedman
1.11 +//
1.12 +// Distributed under the Boost Software License, Version 1.0. (See
1.13 +// accompanying file LICENSE_1_0.txt or copy at
1.14 +// http://www.boost.org/LICENSE_1_0.txt)
1.15 +
1.16 +#ifndef BOOST_VARIANT_STATIC_VISITOR_HPP
1.17 +#define BOOST_VARIANT_STATIC_VISITOR_HPP
1.18 +
1.19 +#include "boost/config.hpp"
1.20 +#include "boost/detail/workaround.hpp"
1.21 +
1.22 +#include "boost/mpl/if.hpp"
1.23 +#include "boost/type_traits/is_base_and_derived.hpp"
1.24 +
1.25 +#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
1.26 +# include "boost/type_traits/is_same.hpp"
1.27 +#endif
1.28 +
1.29 +// should be the last #include
1.30 +#include "boost/type_traits/detail/bool_trait_def.hpp"
1.31 +
1.32 +namespace boost {
1.33 +
1.34 +//////////////////////////////////////////////////////////////////////////
1.35 +// class template static_visitor
1.36 +//
1.37 +// An empty base class that typedefs the return type of a deriving static
1.38 +// visitor. The class is analogous to std::unary_function in this role.
1.39 +//
1.40 +
1.41 +namespace detail {
1.42 +
1.43 + struct is_static_visitor_tag { };
1.44 +
1.45 + typedef void static_visitor_default_return;
1.46 +
1.47 +} // namespace detail
1.48 +
1.49 +template <typename R = ::boost::detail::static_visitor_default_return>
1.50 +class static_visitor
1.51 + : public detail::is_static_visitor_tag
1.52 +{
1.53 +public: // typedefs
1.54 +
1.55 + typedef R result_type;
1.56 +
1.57 +protected: // for use as base class only
1.58 +
1.59 + static_visitor() { }
1.60 + ~static_visitor() { }
1.61 +
1.62 +};
1.63 +
1.64 +//////////////////////////////////////////////////////////////////////////
1.65 +// metafunction is_static_visitor
1.66 +//
1.67 +// Value metafunction indicates whether the specified type derives from
1.68 +// static_visitor<...>.
1.69 +//
1.70 +// NOTE #1: This metafunction does NOT check whether the specified type
1.71 +// fulfills the requirements of the StaticVisitor concept.
1.72 +//
1.73 +// NOTE #2: This template never needs to be specialized!
1.74 +//
1.75 +
1.76 +namespace detail {
1.77 +
1.78 +template <typename T>
1.79 +struct is_static_visitor_impl
1.80 +{
1.81 + BOOST_STATIC_CONSTANT(bool, value =
1.82 + (::boost::is_base_and_derived<
1.83 + detail::is_static_visitor_tag,
1.84 + T
1.85 + >::value));
1.86 +};
1.87 +
1.88 +} // namespace detail
1.89 +
1.90 +BOOST_TT_AUX_BOOL_TRAIT_DEF1(
1.91 + is_static_visitor
1.92 + , T
1.93 + , (::boost::detail::is_static_visitor_impl<T>::value)
1.94 + )
1.95 +
1.96 +} // namespace boost
1.97 +
1.98 +#include "boost/type_traits/detail/bool_trait_undef.hpp"
1.99 +
1.100 +#endif // BOOST_VARIANT_STATIC_VISITOR_HPP