diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-10-19 08:57:20 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-10-19 08:57:20 +0200 |
commit | ed6115361006240e3c7b02295599e4534cc55a13 (patch) | |
tree | 612f12d6c7c49421102041fceb7609db8ab8257e /cutl/details/boost/type_traits/add_rvalue_reference.hpp | |
parent | af8d1a0139ca105c6830f4ac7c320aca2e1c1f5e (diff) |
Update internal Boost subset to 1.54.0
Diffstat (limited to 'cutl/details/boost/type_traits/add_rvalue_reference.hpp')
-rw-r--r-- | cutl/details/boost/type_traits/add_rvalue_reference.hpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/cutl/details/boost/type_traits/add_rvalue_reference.hpp b/cutl/details/boost/type_traits/add_rvalue_reference.hpp new file mode 100644 index 0000000..2adb737 --- /dev/null +++ b/cutl/details/boost/type_traits/add_rvalue_reference.hpp @@ -0,0 +1,66 @@ +// add_rvalue_reference.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_EXT_ADD_RVALUE_REFERENCE__HPP +#define BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP + +#include <cutl/details/boost/config.hpp> + +//----------------------------------------------------------------------------// + +#include <cutl/details/boost/type_traits/is_void.hpp> +#include <cutl/details/boost/type_traits/is_reference.hpp> + +// should be the last #include +#include <cutl/details/boost/type_traits/detail/type_trait_def.hpp> + +//----------------------------------------------------------------------------// +// // +// C++03 implementation of // +// 20.9.7.2 Reference modifications [meta.trans.ref] // +// Written by Vicente J. Botet Escriba // +// // +// If T names an object or function type then the member typedef type +// shall name T&&; otherwise, type shall name T. [ Note: This rule reflects +// the semantics of reference collapsing. For example, when a type T names +// a type T1&, the type add_rvalue_reference<T>::type is not an rvalue +// reference. -end note ] +//----------------------------------------------------------------------------// + +namespace cutl_details_boost { + +namespace type_traits_detail { + + template <typename T, bool b> + struct add_rvalue_reference_helper + { typedef T type; }; + +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + template <typename T> + struct add_rvalue_reference_helper<T, true> + { + typedef T&& type; + }; +#endif + + template <typename T> + struct add_rvalue_reference_imp + { + typedef typename cutl_details_boost::type_traits_detail::add_rvalue_reference_helper + <T, (is_void<T>::value == false && is_reference<T>::value == false) >::type type; + }; + +} + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_rvalue_reference,T,typename cutl_details_boost::type_traits_detail::add_rvalue_reference_imp<T>::type) + +} // namespace cutl_details_boost + +#include <cutl/details/boost/type_traits/detail/type_trait_undef.hpp> + +#endif // BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP + |