utility/declval.hpp
Go to the documentation of this file.
1 // declval.hpp -------------------------------------------------------------//
2 
3 // Copyright 2010 Vicente J. Botet Escriba
4 
5 // Distributed under the Boost Software License, Version 1.0.
6 // See http://www.boost.org/LICENSE_1_0.txt
7 
8 #ifndef BOOST_UTILITY_DECLVAL_HPP
9 #define BOOST_UTILITY_DECLVAL_HPP
10 
11 #include <boost/config.hpp>
12 
13 //----------------------------------------------------------------------------//
14 
16 
17 //----------------------------------------------------------------------------//
18 // //
19 // C++03 implementation of //
20 // 20.2.4 Function template declval [declval] //
21 // Written by Vicente J. Botet Escriba //
22 // //
23 // 1 The library provides the function template declval to simplify the
24 // definition of expressions which occur as unevaluated operands.
25 // 2 Remarks: If this function is used, the program is ill-formed.
26 // 3 Remarks: The template parameter T of declval may be an incomplete type.
27 // [ Example:
28 //
29 // template <class To, class From>
30 // decltype(static_cast<To>(declval<From>())) convert(From&&);
31 //
32 // declares a function template convert which only participates in overloading
33 // if the type From can be explicitly converted to type To. For another example
34 // see class template common_type (20.9.7.6). -end example ]
35 //----------------------------------------------------------------------------//
36 
37 namespace boost {
38 
39  template <typename T>
40  typename add_rvalue_reference<T>::type declval() BOOST_NOEXCEPT; // as unevaluated operand
41 
42 } // namespace boost
43 
44 #endif // BOOST_UTILITY_DECLVAL_HPP
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
add_rvalue_reference< T >::type declval() BOOST_NOEXCEPT
#define BOOST_NOEXCEPT
Definition: suffix.hpp:916
boost::type_traits_detail::add_rvalue_reference_imp< T >::type type


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:12