Moved utility/declval.hpp to type_traits/declval.hpp.

This commit is contained in:
Peter Dimov
2015-06-08 01:55:17 +03:00
parent 01493e4acb
commit 7cb0e840f1
9 changed files with 52 additions and 38 deletions

View File

@ -23,6 +23,7 @@
#include "boost/type_traits/conditional.hpp"
#include "boost/type_traits/copy_cv.hpp"
#include "boost/type_traits/decay.hpp"
#include "boost/type_traits/declval.hpp"
#include "boost/type_traits/extent.hpp"
#include "boost/type_traits/floating_point_promotion.hpp"
#include "boost/type_traits/function_traits.hpp"

View File

@ -11,7 +11,7 @@
#include <boost/config.hpp>
#include <boost/type_traits/decay.hpp>
#include <boost/utility/declval.hpp>
#include <boost/type_traits/declval.hpp>
#if defined(BOOST_NO_CXX11_DECLTYPE)
#include <boost/type_traits/detail/common_type_impl.hpp>

View File

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

View File

@ -31,7 +31,7 @@
#include <boost/type_traits/remove_reference.hpp>
#endif
#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
# include <boost/utility/declval.hpp>
# include <boost/type_traits/declval.hpp>
#endif
#elif defined(BOOST_MSVC) || defined(BOOST_INTEL)
#include <boost/type_traits/is_function.hpp>

View File

@ -18,7 +18,7 @@
&& !defined(BOOST_INTEL_CXX_VERSION) && \
!(defined(BOOST_MSVC) && _MSC_VER == 1800)
#define BOOST_TT_CXX11_IS_COPY_ASSIGNABLE
#include <boost/utility/declval.hpp>
#include <boost/type_traits/declval.hpp>
#else
//For compilers without decltype
#include <boost/type_traits/is_const.hpp>

View File

@ -13,7 +13,7 @@
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/type_traits/add_reference.hpp>
#include <boost/type_traits/is_rvalue_reference.hpp>
#include <boost/utility/declval.hpp>
#include <boost/type_traits/declval.hpp>
#include <boost/noncopyable.hpp>
namespace boost {

View File

@ -17,7 +17,7 @@
#include <boost/type_traits/is_array.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/utility/declval.hpp>
#include <boost/type_traits/declval.hpp>
namespace boost {

View File

@ -31,7 +31,7 @@ template <class T> struct is_nothrow_move_constructible<T&&> : public ::boost::f
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
#include <boost/utility/declval.hpp>
#include <boost/type_traits/declval.hpp>
#include <boost/utility/enable_if.hpp>
namespace boost{ namespace detail{

View File

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