/
usr
/
include
/
boost
/
type_erasure
/
/usr/include/boost/type_erasure
mkdir
upload
Name
Size
Mode
Actions
detail/
-
0755
rm
any.hpp
104285
0644
edit
dl
rm
any_cast.hpp
5492
0644
edit
dl
rm
binding.hpp
9045
0644
edit
dl
rm
binding_of.hpp
763
0644
edit
dl
rm
builtin.hpp
4318
0644
edit
dl
rm
call.hpp
21940
0644
edit
dl
rm
callable.hpp
13126
0644
edit
dl
rm
check_match.hpp
8181
0644
edit
dl
rm
concept_interface.hpp
1876
0644
edit
dl
rm
concept_of.hpp
1456
0644
edit
dl
rm
config.hpp
862
0644
edit
dl
rm
constructible.hpp
5344
0644
edit
dl
rm
deduced.hpp
1575
0644
edit
dl
rm
derived.hpp
927
0644
edit
dl
rm
dynamic_any_cast.hpp
8239
0644
edit
dl
rm
dynamic_binding.hpp
1099
0644
edit
dl
rm
exception.hpp
848
0644
edit
dl
rm
free.hpp
22187
0644
edit
dl
rm
is_empty.hpp
605
0644
edit
dl
rm
is_placeholder.hpp
830
0644
edit
dl
rm
is_subconcept.hpp
5377
0644
edit
dl
rm
iterator.hpp
9799
0644
edit
dl
rm
member.hpp
16813
0644
edit
dl
rm
operators.hpp
23235
0644
edit
dl
rm
param.hpp
9026
0644
edit
dl
rm
placeholder.hpp
2107
0644
edit
dl
rm
placeholder_of.hpp
1480
0644
edit
dl
rm
rebind_any.hpp
2018
0644
edit
dl
rm
register_binding.hpp
6431
0644
edit
dl
rm
relaxed.hpp
2646
0644
edit
dl
rm
require_match.hpp
7418
0644
edit
dl
rm
same_type.hpp
942
0644
edit
dl
rm
static_binding.hpp
831
0644
edit
dl
rm
tuple.hpp
17723
0644
edit
dl
rm
typeid_of.hpp
1866
0644
edit
dl
rm
Edit:
/usr/include/boost/type_erasure/param.hpp
(9026B)
// Boost.TypeErasure library // // Copyright 2011 Steven Watanabe // // 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) // // $Id$ #ifndef BOOST_TYPE_ERASURE_PARAM_HPP_INCLUDED #define BOOST_TYPE_ERASURE_PARAM_HPP_INCLUDED #include <boost/config.hpp> #include <boost/utility/enable_if.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/type_traits/add_const.hpp> #include <boost/type_traits/remove_cv.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/mpl/bool.hpp> #include <boost/mpl/if.hpp> #include <boost/type_erasure/detail/access.hpp> #include <boost/type_erasure/detail/storage.hpp> #include <boost/type_erasure/is_placeholder.hpp> #include <boost/type_erasure/concept_of.hpp> namespace boost { namespace type_erasure { #ifndef BOOST_TYPE_ERASURE_DOXYGEN template<class Concept, class T> class any; template<class Concept> class binding; #endif namespace detail { struct access; } namespace detail { template<class From, class To> struct placeholder_conversion : boost::mpl::false_ {}; template<class T> struct placeholder_conversion<T, T> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<T, T&> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<T, const T&> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<const T, T> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<const T, const T&> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<T&, T> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<T&, T&> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<T&, const T&> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<const T&, T> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<const T&, const T&> : boost::mpl::true_ {}; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template<class T> struct placeholder_conversion<T&&, T> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<T&&, const T&> : boost::mpl::true_ {}; template<class T> struct placeholder_conversion<T&&, T&&> : boost::mpl::true_ {}; #endif } /** * \brief A wrapper to help with overload resolution for functions * operating on an @ref any. * * The template arguments are interpreted in * the same way as @ref any. * * A parameter of type @ref param can be initialized * with an @ref any that has the same @c Concept * and base placeholder when there exists a corresponding * standard conversion for the placeholder. * A conversion sequence from @ref any "any<C, P>" to @ref param "param<C, P1>" is * a better conversion sequence than @ref any "any<C, P>" to @ref param "param<C, P2>" * iff the corresponding placeholder standard conversion * sequence from P to P1 is a better conversion sequence than * P to P2. * * \note Overloading based on cv-qualifiers and rvalue-ness is * only supported in C++11. In C++03, all conversion sequences * from @ref any to @ref param have the same rank. * * Example: * * \code * void f(param<C, _a&>); * void f(param<C, const _a&>); * void g(param<C, const _a&>); * void g(param<C, _a&&>); * * any<C, _a> a; * f(any<C, _a>()); // calls void f(param<C, const _a&>); * f(a); // calls void f(param<C, _a&>); (ambiguous in C++03) * g(any<C, _a>()); // calls void g(param<C, _a&&>); (ambiguous in C++03) * g(a); // calls void g(param<C, const _a&>); * \endcode * */ template<class Concept, class T> class param { public: friend struct boost::type_erasure::detail::access; /** INTERNAL ONLY */ typedef void _boost_type_erasure_is_any; /** INTERNAL ONLY */ typedef param _boost_type_erasure_derived_type; template<class U> param(any<Concept, U>& a #ifndef BOOST_TYPE_ERASURE_DOXYGEN , typename boost::enable_if< ::boost::type_erasure::detail::placeholder_conversion<U, T> >::type* = 0 #endif ) : _impl(a) {} template<class U> param(const any<Concept, U>& a #ifndef BOOST_TYPE_ERASURE_DOXYGEN , typename boost::enable_if< ::boost::type_erasure::detail::placeholder_conversion< typename ::boost::add_const<U>::type, T > >::type* = 0 #endif ) : _impl(a) {} #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template<class U> param(any<Concept, U>&& a #ifndef BOOST_TYPE_ERASURE_DOXYGEN , typename boost::enable_if< ::boost::type_erasure::detail::placeholder_conversion< U&&, T > >::type* = 0 #endif ) : _impl(std::move(a)) {} #endif /** INTERNAL ONLY */ param(const ::boost::type_erasure::detail::storage& data, const ::boost::type_erasure::binding<Concept>& table) : _impl(data, table) {} /** Returns the stored @ref any. */ any<Concept, T> get() const { return _impl; } private: any<Concept, T> _impl; }; #if !defined(BOOST_NO_CXX11_REF_QUALIFIERS) && !defined(BOOST_TYPE_ERASURE_DOXYGEN) template<class Concept, class T> class param<Concept, const T&> { public: friend struct boost::type_erasure::detail::access; /** INTERNAL ONLY */ typedef void _boost_type_erasure_is_any; /** INTERNAL ONLY */ typedef param _boost_type_erasure_derived_type; param(const ::boost::type_erasure::detail::storage& data, const ::boost::type_erasure::binding<Concept>& table) : _impl(data, table) {} template<class U> param(U& u, typename boost::enable_if< ::boost::is_same<U, const any<Concept, T> > >::type* = 0) : _impl(u) {} any<Concept, const T&> get() const { return _impl; } protected: struct _impl_t { _impl_t(const ::boost::type_erasure::detail::storage& data_, const ::boost::type_erasure::binding<Concept>& table_) : table(table_), data(data_) {} _impl_t(const any<Concept, T>& u) : table(::boost::type_erasure::detail::access::table(u)), data(::boost::type_erasure::detail::access::data(u)) {} // It's safe to capture the table by reference, because // the user's argument should out-live us. storage is // just a void*, so we don't need to add indirection. const ::boost::type_erasure::binding<Concept>& table; ::boost::type_erasure::detail::storage data; } _impl; }; template<class Concept, class T> class param<Concept, T&> : public param<Concept, const T&> { public: friend struct boost::type_erasure::detail::access; /** INTERNAL ONLY */ typedef void _boost_type_erasure_is_any; /** INTERNAL ONLY */ typedef param _boost_type_erasure_derived_type; param(const ::boost::type_erasure::detail::storage& data, const ::boost::type_erasure::binding<Concept>& table) : param<Concept, const T&>(data, table) {} any<Concept, T&> get() const { return any<Concept, T&>( ::boost::type_erasure::detail::access::data(this->_impl), ::boost::type_erasure::detail::access::table(this->_impl)); } }; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES template<class Concept, class T> class param<Concept, T&&> : public param<Concept, const T&> { public: friend struct boost::type_erasure::detail::access; /** INTERNAL ONLY */ typedef void _boost_type_erasure_is_any; /** INTERNAL ONLY */ typedef param _boost_type_erasure_derived_type; param(const ::boost::type_erasure::detail::storage& data, const ::boost::type_erasure::binding<Concept>& table) : param<Concept, const T&>(data, table) {} any<Concept, T&&> get() const { return any<Concept, T&&>( ::boost::type_erasure::detail::access::data(this->_impl), ::boost::type_erasure::detail::access::table(this->_impl)); } }; #endif #endif /** * \brief Metafunction that creates a @ref param. * * If @c T is a (cv/reference qualified) placeholder, * returns @ref param<@ref concept_of "concept_of<Any>::type", T>, * otherwise, returns T. This metafunction is intended * to be used for function arguments in specializations of * @ref concept_interface. * * \see derived, rebind_any */ template<class Any, class T> struct as_param { #ifdef BOOST_TYPE_ERASURE_DOXYGEN typedef detail::unspecified type; #else typedef typename ::boost::mpl::if_< ::boost::type_erasure::is_placeholder< typename ::boost::remove_cv< typename ::boost::remove_reference<T>::type>::type>, param<typename ::boost::type_erasure::concept_of<Any>::type, T>, T >::type type; #endif }; #ifndef BOOST_NO_CXX11_TEMPLATE_ALIASES template<class Any, class T> using as_param_t = typename ::boost::type_erasure::as_param<Any, T>::type; #endif } } #endif
Save
cmd:
run