Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 01b856e70e.
PrevUpHomeNext

declval

template <class T>
typename add_rvalue_reference<T>::type declval() noexcept; // as unevaluated operand

C++ Standard Reference: C++11 20.2.4 [declval].

Header: #include <boost/type_traits/declval.hpp> or #include <boost/type_traits.hpp>

The function template declval is used when a value of a certain type is required in a type computation context. For example, the type of the result of adding an int and a float can be obtained with the expression decltype( declval<int>() + declval<float>() ).


PrevUpHomeNext