Chris@16: // declval.hpp -------------------------------------------------------------// Chris@16: Chris@16: // Copyright 2010 Vicente J. Botet Escriba Chris@16: Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // See http://www.boost.org/LICENSE_1_0.txt Chris@16: Chris@16: #ifndef BOOST_UTILITY_DECLVAL_HPP Chris@16: #define BOOST_UTILITY_DECLVAL_HPP Chris@16: Chris@16: #include Chris@16: Chris@16: //----------------------------------------------------------------------------// Chris@16: Chris@16: #include Chris@16: Chris@16: //----------------------------------------------------------------------------// Chris@16: // // Chris@16: // C++03 implementation of // Chris@16: // 20.2.4 Function template declval [declval] // Chris@16: // Written by Vicente J. Botet Escriba // Chris@16: // // Chris@16: // 1 The library provides the function template declval to simplify the Chris@16: // definition of expressions which occur as unevaluated operands. Chris@16: // 2 Remarks: If this function is used, the program is ill-formed. Chris@16: // 3 Remarks: The template parameter T of declval may be an incomplete type. Chris@16: // [ Example: Chris@16: // Chris@16: // template Chris@16: // decltype(static_cast(declval())) convert(From&&); Chris@16: // Chris@16: // declares a function template convert which only participates in overloading Chris@16: // if the type From can be explicitly converted to type To. For another example Chris@16: // see class template common_type (20.9.7.6). -end example ] Chris@16: //----------------------------------------------------------------------------// Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: template Chris@16: typename add_rvalue_reference::type declval() BOOST_NOEXCEPT; // as unevaluated operand Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #endif // BOOST_UTILITY_DECLVAL_HPP