![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /proc/self/root/usr/include/boost/accumulators/framework/accumulators/ |
Upload File : |
/////////////////////////////////////////////////////////////////////////////// // reference_accumulator.hpp // // Copyright 2005 Eric Niebler. 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 BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_REFERENCE_ACCUMULATOR_HPP_EAN_03_23_2006 #define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_REFERENCE_ACCUMULATOR_HPP_EAN_03_23_2006 #include <boost/ref.hpp> #include <boost/mpl/always.hpp> #include <boost/parameter/keyword.hpp> #include <boost/accumulators/framework/depends_on.hpp> // for feature_tag #include <boost/accumulators/framework/accumulator_base.hpp> #include <boost/accumulators/framework/extractor.hpp> namespace boost { namespace accumulators { namespace impl { ////////////////////////////////////////////////////////////////////////// // reference_accumulator_impl // template<typename Referent, typename Tag> struct reference_accumulator_impl : accumulator_base { typedef Referent &result_type; template<typename Args> reference_accumulator_impl(Args const &args) : ref(args[parameter::keyword<Tag>::instance]) { } result_type result(dont_care) const { return this->ref; } private: reference_wrapper<Referent> ref; }; } // namespace impl namespace tag { ////////////////////////////////////////////////////////////////////////// // reference_tag template<typename Tag> struct reference_tag { }; ////////////////////////////////////////////////////////////////////////// // reference template<typename Referent, typename Tag> struct reference : depends_on<> { /// INTERNAL ONLY /// typedef mpl::always<accumulators::impl::reference_accumulator_impl<Referent, Tag> > impl; }; } namespace extract { BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, reference, (typename)(typename)) BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, reference_tag, (typename)) } using extract::reference; using extract::reference_tag; // Map all reference<V,T> features to reference_tag<T> so // that references can be extracted using reference_tag<T> // without specifying the referent type. template<typename ValueType, typename Tag> struct feature_of<tag::reference<ValueType, Tag> > : feature_of<tag::reference_tag<Tag> > { }; }} // namespace boost::accumulators #endif