![]() 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/thread-self/root/usr/include/boost/accumulators/framework/accumulators/ |
Upload File : |
/////////////////////////////////////////////////////////////////////////////// // value_accumulator.hpp // // Copyright 2005 Eric Niebler, Daniel Egloff. 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_VALUE_ACCUMULATOR_HPP_EAN_03_23_2006 #define BOOST_ACCUMULATORS_FRAMEWORK_ACCUMULATORS_VALUE_ACCUMULATOR_HPP_EAN_03_23_2006 #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 { ////////////////////////////////////////////////////////////////////////// // value_accumulator_impl template<typename ValueType, typename Tag> struct value_accumulator_impl : accumulator_base { typedef ValueType result_type; template<typename Args> value_accumulator_impl(Args const &args) : val(args[parameter::keyword<Tag>::instance]) { } result_type result(dont_care) const { return this->val; } private: ValueType val; }; } // namespace impl namespace tag { ////////////////////////////////////////////////////////////////////////// // value_tag template<typename Tag> struct value_tag { }; ////////////////////////////////////////////////////////////////////////// // value template<typename ValueType, typename Tag> struct value : depends_on<> { /// INTERNAL ONLY /// typedef mpl::always<accumulators::impl::value_accumulator_impl<ValueType, Tag> > impl; }; } namespace extract { BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, value, (typename)(typename)) BOOST_ACCUMULATORS_DEFINE_EXTRACTOR(tag, value_tag, (typename)) } using extract::value; using extract::value_tag; // Map all value<V,T> features to value_tag<T> so // that values can be extracted using value_tag<T> // without specifying the value type. template<typename ValueType, typename Tag> struct feature_of<tag::value<ValueType, Tag> > : feature_of<tag::value_tag<Tag> > { }; }} // namespace boost::accumulators #endif