|
||||
File indexing completed on 2025-01-30 10:01:38
0001 // declval.hpp -------------------------------------------------------------// 0002 0003 // Copyright 2010 Vicente J. Botet Escriba 0004 0005 // Distributed under the Boost Software License, Version 1.0. 0006 // See http://www.boost.org/LICENSE_1_0.txt 0007 0008 #ifndef BOOST_TYPE_TRAITS_DECLVAL_HPP_INCLUDED 0009 #define BOOST_TYPE_TRAITS_DECLVAL_HPP_INCLUDED 0010 0011 #include <boost/config.hpp> 0012 0013 //----------------------------------------------------------------------------// 0014 0015 #include <boost/type_traits/add_rvalue_reference.hpp> 0016 0017 //----------------------------------------------------------------------------// 0018 // // 0019 // C++03 implementation of // 0020 // 20.2.4 Function template declval [declval] // 0021 // Written by Vicente J. Botet Escriba // 0022 // // 0023 // 1 The library provides the function template declval to simplify the 0024 // definition of expressions which occur as unevaluated operands. 0025 // 2 Remarks: If this function is used, the program is ill-formed. 0026 // 3 Remarks: The template parameter T of declval may be an incomplete type. 0027 // [ Example: 0028 // 0029 // template <class To, class From> 0030 // decltype(static_cast<To>(declval<From>())) convert(From&&); 0031 // 0032 // declares a function template convert which only participates in overloading 0033 // if the type From can be explicitly converted to type To. For another example 0034 // see class template common_type (20.9.7.6). -end example ] 0035 //----------------------------------------------------------------------------// 0036 0037 namespace boost { 0038 0039 template <typename T> 0040 typename add_rvalue_reference<T>::type declval() BOOST_NOEXCEPT; // as unevaluated operand 0041 0042 } // namespace boost 0043 0044 #endif // BOOST_TYPE_TRAITS_DECLVAL_HPP_INCLUDED
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |