template<classT>
-typenamestd::add_rvalue_reference<T>::typedeclval();// not used
-
+typenamestd::add_rvalue_reference<T>::typedeclval();// not used
+
which ensures that we can also use cv void as template parameter. The careful
reader might have noticed that declval() already exists under the name create() as
@@ -119,10 +120,10 @@
+ typenameadd_rvalue_reference<T>::typedeclval()noexcept;// as unevaluated operand
+
+}// namespace boost
+
The library provides the function template declval to simplify the definition
of expressions which occur as unevaluated operands.
@@ -142,7 +143,7 @@
Example:
+ 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)
+
+ BOOST_EXPLICIT_OPERATOR_BOOL() and BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL() are compatibility helper macros that expand
+ to an explicit conversion operator to bool.
+ For compilers not supporting explicit conversion operators introduced in C++11
+ the macros expand to a conversion operator that implements the safe
+ bool idiom. In case if the compiler is not able to handle safe bool
+ idiom well the macros expand to a regular conversion operator to bool.
+
+ Both macros are intended to be placed within a user's class definition. The
+ generated conversion operators will be implemented in terms of operator!()
+ that should be defined by user in this class. In case of BOOST_CONSTEXPR_EXPLICIT_OPERATOR_BOOL() the generated conversion operator will be
+ declared constexpr which requires
+ the corresponding operator!()
+ to also be constexpr.
+
In a compiler which supports C++0x default arguments for function template parameters, you can
enable and disable function templates by adding an additional template parameter. This approach
@@ -416,7 +416,7 @@ subscript operators).
-