split headers: type_traits/std_type_traits.hpp

This commit is contained in:
bolero-MURAKAMI 2015-04-04 23:12:53 +09:00
parent 3c2733ad0b
commit 0bfeeb755a
89 changed files with 2634 additions and 682 deletions

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_ADD_CONST_HPP
#define SPROUT_TYPE_TRAITS_ADD_CONST_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// add_const
//
using std::add_const;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using add_const_t = typename sprout::add_const<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_ADD_CONST_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_ADD_CV_HPP
#define SPROUT_TYPE_TRAITS_ADD_CV_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// add_cv
//
using std::add_cv;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using add_cv_t = typename sprout::add_cv<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_ADD_CV_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_ADD_LVALUE_REFERENCE_HPP
#define SPROUT_TYPE_TRAITS_ADD_LVALUE_REFERENCE_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// add_lvalue_reference
//
using std::add_lvalue_reference;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using add_lvalue_reference_t = typename sprout::add_lvalue_reference<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_ADD_LVALUE_REFERENCE_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_ADD_POINTER_HPP
#define SPROUT_TYPE_TRAITS_ADD_POINTER_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// add_pointer
//
using std::add_pointer;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using add_pointer_t = typename sprout::add_pointer<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_ADD_POINTER_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_ADD_RVALUE_REFERENCE_HPP
#define SPROUT_TYPE_TRAITS_ADD_RVALUE_REFERENCE_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// add_rvalue_reference
//
using std::add_rvalue_reference;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using add_rvalue_reference_t = typename sprout::add_rvalue_reference<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_ADD_RVALUE_REFERENCE_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_ADD_VOLATILE_HPP
#define SPROUT_TYPE_TRAITS_ADD_VOLATILE_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// add_volatile
//
using std::add_volatile;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using add_volatile_t = typename sprout::add_volatile<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_ADD_VOLATILE_HPP

View file

@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_ALIGNED_STORAGE_HPP
#define SPROUT_TYPE_TRAITS_ALIGNED_STORAGE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/type_traits/alignment_of.hpp>
namespace sprout {
//
// aligned_storage
//
using std::aligned_storage;
#if SPROUT_USE_TEMPLATE_ALIASES
template<
std::size_t Len,
std::size_t Align = sprout::alignment_of<typename sprout::aligned_storage<Len>::type>::value
>
using aligned_storage_t = typename sprout::aligned_storage<Len, Align>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_ALIGNED_STORAGE_HPP

View file

@ -0,0 +1,41 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_ALIGNED_UNION_HPP
#define SPROUT_TYPE_TRAITS_ALIGNED_UNION_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/type_traits/alignment_of.hpp>
#if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)
# include <sprout/tpp/algorithm/max_element.hpp>
#endif
namespace sprout {
//
// aligned_union
//
#if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)
template<std::size_t Len, typename... Types>
struct aligned_union
: public std::aligned_storage<
sprout::tpp::max_element_c<std::size_t, Len, sizeof(Types)...>::value,
sprout::tpp::max_element_c<std::size_t, sprout::alignment_of<Types>::value...>::value
>
{};
#else // #if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)
using std::aligned_union;
#endif // #if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)
#if SPROUT_USE_TEMPLATE_ALIASES
template<std::size_t Len, typename... Types>
using aligned_union_t = typename sprout::aligned_union<Len, Types...>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_ALIGNED_UNION_HPP

View file

@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_ALIGNMENT_OF_HPP
#define SPROUT_TYPE_TRAITS_ALIGNMENT_OF_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// alignment_of
//
template<typename T>
struct alignment_of
: public sprout::detail::type_traits_wrapper<std::alignment_of<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR std::size_t alignment_of_v = sprout::alignment_of<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_ALIGNMENT_OF_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_CONDITIONAL_HPP
#define SPROUT_TYPE_TRAITS_CONDITIONAL_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// conditional
//
using std::conditional;
#if SPROUT_USE_TEMPLATE_ALIASES
template<bool B, typename T, typename F>
using conditional_t = typename sprout::conditional<B, T, F>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_CONDITIONAL_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_DECAY_HPP
#define SPROUT_TYPE_TRAITS_DECAY_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// decay
//
using std::decay;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using decay_t = typename sprout::decay<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_DECAY_HPP

View file

@ -9,10 +9,13 @@
#define SPROUT_TYPE_TRAITS_ENABLE_IF_HPP
#include <sprout/config.hpp>
#include <sprout/type_traits/std_type_traits.hpp>
#include <sprout/type_traits/std_type_aliases.hpp>
namespace sprout {
//
// enable_if
//
using std::enable_if;
//
// disable_if
//
@ -22,6 +25,9 @@ namespace sprout {
{};
#if SPROUT_USE_TEMPLATE_ALIASES
template<bool B, typename T = void>
using enable_if_t = typename sprout::enable_if<B, T>::type;
template<bool B, typename T = void>
using disable_if_t = typename sprout::disable_if<B, T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES

View file

@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_EXTENT_HPP
#define SPROUT_TYPE_TRAITS_EXTENT_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// extent
//
template<typename T, unsigned I = 0>
struct extent
: public sprout::detail::type_traits_wrapper<std::extent<T, I> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, unsigned I = 0>
SPROUT_STATIC_CONSTEXPR std::size_t extent_v = sprout::extent<T, I>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_EXTENT_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_HPP
#define SPROUT_TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// has_virtual_destructor
//
template<typename T>
struct has_virtual_destructor
: public sprout::detail::type_traits_wrapper<std::has_virtual_destructor<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool has_virtual_destructor_v = sprout::has_virtual_destructor<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_HAS_VIRTUAL_DESTRUCTOR_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_ABSTRACT_HPP
#define SPROUT_TYPE_TRAITS_IS_ABSTRACT_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_abstract
//
template<typename T>
struct is_abstract
: public sprout::detail::type_traits_wrapper<std::is_abstract<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_abstract_v = sprout::is_abstract<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_ABSTRACT_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_ARITHMETIC_HPP
#define SPROUT_TYPE_TRAITS_IS_ARITHMETIC_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_arithmetic
//
template<typename T>
struct is_arithmetic
: public sprout::detail::type_traits_wrapper<std::is_arithmetic<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_arithmetic_v = sprout::is_arithmetic<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_ARITHMETIC_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_ARRAY_HPP
#define SPROUT_TYPE_TRAITS_IS_ARRAY_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_array
//
template<typename T>
struct is_array
: public sprout::detail::type_traits_wrapper<std::is_array<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_array_v = sprout::is_array<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_ARRAY_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_ASSIGNABLE_HPP
#define SPROUT_TYPE_TRAITS_IS_ASSIGNABLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_assignable
//
template<typename T, typename U>
struct is_assignable
: public sprout::detail::type_traits_wrapper<std::is_assignable<T, U> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U>
SPROUT_STATIC_CONSTEXPR bool is_assignable_v = sprout::is_assignable<T, U>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_ASSIGNABLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_BASE_OF_HPP
#define SPROUT_TYPE_TRAITS_IS_BASE_OF_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_base_of
//
template<typename From, typename To>
struct is_base_of
: public sprout::detail::type_traits_wrapper<std::is_base_of<From, To> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename From, typename To>
SPROUT_STATIC_CONSTEXPR bool is_base_of_v = sprout::is_base_of<From, To>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_BASE_OF_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_CLASS_HPP
#define SPROUT_TYPE_TRAITS_IS_CLASS_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_class
//
template<typename T>
struct is_class
: public sprout::detail::type_traits_wrapper<std::is_class<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_class_v = sprout::is_class<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_CLASS_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_COMPOUND_HPP
#define SPROUT_TYPE_TRAITS_IS_COMPOUND_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_compound
//
template<typename T>
struct is_compound
: public sprout::detail::type_traits_wrapper<std::is_compound<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_compound_v = sprout::is_compound<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_COMPOUND_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_CONST_HPP
#define SPROUT_TYPE_TRAITS_IS_CONST_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_const
//
template<typename T>
struct is_const
: public sprout::detail::type_traits_wrapper<std::is_const<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_const_v = sprout::is_const<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_CONST_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_constructible
//
template<typename T, typename... Args>
struct is_constructible
: public sprout::detail::type_traits_wrapper<std::is_constructible<T, Args...> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename... Args>
SPROUT_STATIC_CONSTEXPR bool is_constructible_v = sprout::is_constructible<T, Args...>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_CONSTRUCTIBLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_CONVERTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_CONVERTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_convertible
//
template<typename From, typename To>
struct is_convertible
: public sprout::detail::type_traits_wrapper<std::is_convertible<From, To> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename From, typename To>
SPROUT_STATIC_CONSTEXPR bool is_convertible_v = sprout::is_convertible<From, To>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_CONVERTIBLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_COPY_ASSIGNABLE_HPP
#define SPROUT_TYPE_TRAITS_IS_COPY_ASSIGNABLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_copy_assignable
//
template<typename T>
struct is_copy_assignable
: public sprout::detail::type_traits_wrapper<std::is_copy_assignable<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_copy_assignable_v = sprout::is_copy_assignable<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_COPY_ASSIGNABLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_copy_constructible
//
template<typename T>
struct is_copy_constructible
: public sprout::detail::type_traits_wrapper<std::is_copy_constructible<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_copy_constructible_v = sprout::is_copy_constructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_COPY_CONSTRUCTIBLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_default_constructible
//
template<typename T>
struct is_default_constructible
: public sprout::detail::type_traits_wrapper<std::is_default_constructible<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_default_constructible_v = sprout::is_default_constructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_DEFAULT_CONSTRUCTIBLE_HPP

View file

@ -64,6 +64,11 @@ namespace sprout {
struct is_destructible
: public sprout::detail::is_destructible_impl<T>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_destructible_v = sprout::is_destructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_DESTRUCTIBLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_EMPTY_HPP
#define SPROUT_TYPE_TRAITS_IS_EMPTY_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_empty
//
template<typename T>
struct is_empty
: public sprout::detail::type_traits_wrapper<std::is_empty<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_empty_v = sprout::is_empty<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_EMPTY_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_ENUM_HPP
#define SPROUT_TYPE_TRAITS_IS_ENUM_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_enum
//
template<typename T>
struct is_enum
: public sprout::detail::type_traits_wrapper<std::is_enum<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_enum_v = sprout::is_enum<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_ENUM_HPP

View file

@ -0,0 +1,37 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_FINAL_HPP
#define SPROUT_TYPE_TRAITS_IS_FINAL_HPP
#include <sprout/config.hpp>
#include <sprout/detail/predef.hpp>
#include <sprout/type_traits/integral_constant.hpp>
namespace sprout {
//
// is_final
//
#if SPROUT_CLANG_HAS_FUTURE(is_final) || SPROUT_GCC_OR_LATER(4, 7, 0)
template<typename T>
struct is_final
: public sprout::bool_constant<__is_final(T)>
{};
#else // #if SPROUT_CLANG_HAS_FUTURE(is_final) || SPROUT_GCC_OR_LATER(4, 7, 0)
template<typename T>
struct is_final
: public sprout::false_type
{};
#endif // #if SPROUT_CLANG_HAS_FUTURE(is_final) || SPROUT_GCC_OR_LATER(4, 7, 0)
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_final_v = sprout::is_final<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_FINAL_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_FLOATING_POINT_HPP
#define SPROUT_TYPE_TRAITS_IS_FLOATING_POINT_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_floating_point
//
template<typename T>
struct is_floating_point
: public sprout::detail::type_traits_wrapper<std::is_floating_point<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_floating_point_v = sprout::is_floating_point<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_FLOATING_POINT_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_FUNCTION_HPP
#define SPROUT_TYPE_TRAITS_IS_FUNCTION_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_function
//
template<typename T>
struct is_function
: public sprout::detail::type_traits_wrapper<std::is_function<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_function_v = sprout::is_function<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_FUNCTION_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_FUNDAMENTAL_HPP
#define SPROUT_TYPE_TRAITS_IS_FUNDAMENTAL_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_fundamental
//
template<typename T>
struct is_fundamental
: public sprout::detail::type_traits_wrapper<std::is_fundamental<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_fundamental_v = sprout::is_fundamental<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_FUNDAMENTAL_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_INTEGRAL_HPP
#define SPROUT_TYPE_TRAITS_IS_INTEGRAL_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_integral
//
template<typename T>
struct is_integral
: public sprout::detail::type_traits_wrapper<std::is_integral<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_integral_v = sprout::is_integral<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_INTEGRAL_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_LITERAL_TYPE_HPP
#define SPROUT_TYPE_TRAITS_IS_LITERAL_TYPE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_literal_type
//
template<typename T>
struct is_literal_type
: public sprout::detail::type_traits_wrapper<std::is_literal_type<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_literal_type_v = sprout::is_literal_type<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_LITERAL_TYPE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_LVALUE_REFERENCE_HPP
#define SPROUT_TYPE_TRAITS_IS_LVALUE_REFERENCE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_lvalue_reference
//
template<typename T>
struct is_lvalue_reference
: public sprout::detail::type_traits_wrapper<std::is_lvalue_reference<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_lvalue_reference_v = sprout::is_lvalue_reference<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_LVALUE_REFERENCE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_HPP
#define SPROUT_TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_member_function_pointer
//
template<typename T>
struct is_member_function_pointer
: public sprout::detail::type_traits_wrapper<std::is_member_function_pointer<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_member_function_pointer_v = sprout::is_member_function_pointer<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_MEMBER_FUNCTION_POINTER_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_MEMBER_OBJECT_POINTER_HPP
#define SPROUT_TYPE_TRAITS_IS_MEMBER_OBJECT_POINTER_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_member_object_pointer
//
template<typename T>
struct is_member_object_pointer
: public sprout::detail::type_traits_wrapper<std::is_member_object_pointer<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_member_object_pointer_v = sprout::is_member_object_pointer<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_MEMBER_OBJECT_POINTER_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_MEMBER_POINTER_HPP
#define SPROUT_TYPE_TRAITS_IS_MEMBER_POINTER_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_member_pointer
//
template<typename T>
struct is_member_pointer
: public sprout::detail::type_traits_wrapper<std::is_member_pointer<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_member_pointer_v = sprout::is_member_pointer<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_MEMBER_POINTER_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_MOVE_ASSIGNABLE_HPP
#define SPROUT_TYPE_TRAITS_IS_MOVE_ASSIGNABLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_move_assignable
//
template<typename T>
struct is_move_assignable
: public sprout::detail::type_traits_wrapper<std::is_move_assignable<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_move_assignable_v = sprout::is_move_assignable<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_MOVE_ASSIGNABLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_move_constructible
//
template<typename T>
struct is_move_constructible
: public sprout::detail::type_traits_wrapper<std::is_move_constructible<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_move_constructible_v = sprout::is_move_constructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_MOVE_CONSTRUCTIBLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_HPP
#define SPROUT_TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_nothrow_assignable
//
template<typename T, typename U>
struct is_nothrow_assignable
: public sprout::detail::type_traits_wrapper<std::is_nothrow_assignable<T, U> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_assignable_v = sprout::is_nothrow_assignable<T, U>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_ASSIGNABLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_nothrow_constructible
//
template<typename T, typename... Args>
struct is_nothrow_constructible
: public sprout::detail::type_traits_wrapper<std::is_nothrow_constructible<T, Args...> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename... Args>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_constructible_v = sprout::is_nothrow_constructible<T, Args...>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_CONSTRUCTIBLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_HPP
#define SPROUT_TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_nothrow_copy_assignable
//
template<typename T>
struct is_nothrow_copy_assignable
: public sprout::detail::type_traits_wrapper<std::is_nothrow_copy_assignable<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_copy_assignable_v = sprout::is_nothrow_copy_assignable<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_COPY_ASSIGNABLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_nothrow_copy_constructible
//
template<typename T>
struct is_nothrow_copy_constructible
: public sprout::detail::type_traits_wrapper<std::is_nothrow_copy_constructible<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_copy_constructible_v = sprout::is_nothrow_copy_constructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_COPY_CONSTRUCTIBLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_nothrow_default_constructible
//
template<typename T>
struct is_nothrow_default_constructible
: public sprout::detail::type_traits_wrapper<std::is_nothrow_default_constructible<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_default_constructible_v = sprout::is_nothrow_default_constructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_DEFAULT_CONSTRUCTIBLE_HPP

View file

@ -61,6 +61,11 @@ namespace sprout {
struct is_nothrow_destructible
: public sprout::detail::is_nothrow_destructible_impl<T>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_destructible_v = sprout::is_nothrow_destructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_DESTRUCTIBLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_HPP
#define SPROUT_TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_nothrow_move_assignable
//
template<typename T>
struct is_nothrow_move_assignable
: public sprout::detail::type_traits_wrapper<std::is_nothrow_move_assignable<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_move_assignable_v = sprout::is_nothrow_move_assignable<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_MOVE_ASSIGNABLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_nothrow_move_constructible
//
template<typename T>
struct is_nothrow_move_constructible
: public sprout::detail::type_traits_wrapper<std::is_nothrow_move_constructible<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_move_constructible_v = sprout::is_nothrow_move_constructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_NOTHROW_MOVE_CONSTRUCTIBLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_OBJECT_HPP
#define SPROUT_TYPE_TRAITS_IS_OBJECT_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_object
//
template<typename T>
struct is_object
: public sprout::detail::type_traits_wrapper<std::is_object<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_object_v = sprout::is_object<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_OBJECT_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_POD_HPP
#define SPROUT_TYPE_TRAITS_IS_POD_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_pod
//
template<typename T>
struct is_pod
: public sprout::detail::type_traits_wrapper<std::is_pod<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_pod_v = sprout::is_pod<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_POD_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_POINTER_HPP
#define SPROUT_TYPE_TRAITS_IS_POINTER_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_pointer
//
template<typename T>
struct is_pointer
: public sprout::detail::type_traits_wrapper<std::is_pointer<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_pointer_v = sprout::is_pointer<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_POINTER_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_POLYMORPHIC_HPP
#define SPROUT_TYPE_TRAITS_IS_POLYMORPHIC_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_polymorphic
//
template<typename T>
struct is_polymorphic
: public sprout::detail::type_traits_wrapper<std::is_polymorphic<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_polymorphic_v = sprout::is_polymorphic<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_POLYMORPHIC_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_REFERENCE_HPP
#define SPROUT_TYPE_TRAITS_IS_REFERENCE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_reference
//
template<typename T>
struct is_reference
: public sprout::detail::type_traits_wrapper<std::is_reference<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_reference_v = sprout::is_reference<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_REFERENCE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_RVALUE_REFERENCE_HPP
#define SPROUT_TYPE_TRAITS_IS_RVALUE_REFERENCE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_rvalue_reference
//
template<typename T>
struct is_rvalue_reference
: public sprout::detail::type_traits_wrapper<std::is_rvalue_reference<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_rvalue_reference_v = sprout::is_rvalue_reference<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_RVALUE_REFERENCE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_SAME_HPP
#define SPROUT_TYPE_TRAITS_IS_SAME_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_same
//
template<typename T, typename U>
struct is_same
: public sprout::detail::type_traits_wrapper<std::is_same<T, U> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U>
SPROUT_STATIC_CONSTEXPR bool is_same_v = sprout::is_same<T, U>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_SAME_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_SCALAR_HPP
#define SPROUT_TYPE_TRAITS_IS_SCALAR_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_scalar
//
template<typename T>
struct is_scalar
: public sprout::detail::type_traits_wrapper<std::is_scalar<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_scalar_v = sprout::is_scalar<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_SCALAR_HPP

View file

@ -31,6 +31,11 @@ namespace sprout {
struct is_signed
: public sprout::detail::is_signed_impl<T>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_signed_v = sprout::is_signed<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_SIGNED_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_STANDARD_LAYOUT_HPP
#define SPROUT_TYPE_TRAITS_IS_STANDARD_LAYOUT_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_standard_layout
//
template<typename T>
struct is_standard_layout
: public sprout::detail::type_traits_wrapper<std::is_standard_layout<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_standard_layout_v = sprout::is_standard_layout<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_STANDARD_LAYOUT_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_TRIVIAL_HPP
#define SPROUT_TYPE_TRAITS_IS_TRIVIAL_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_trivial
//
template<typename T>
struct is_trivial
: public sprout::detail::type_traits_wrapper<std::is_trivial<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivial_v = sprout::is_trivial<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_TRIVIAL_HPP

View file

@ -0,0 +1,67 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_HPP
#define SPROUT_TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/detail/predef.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/is_scalar.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_trivially_assignable
//
#if !defined(_LIBCPP_VERSION)
#if SPROUT_CLANG_HAS_FUTURE(is_trivially_assignable)
template<typename T, typename U>
struct is_trivially_assignable
: public sprout::bool_constant<__is_trivially_assignable(T, U)>
{};
#else // #if SPROUT_CLANG_HAS_FUTURE(is_trivially_assignable)
template<typename T, typename U>
struct is_trivially_assignable
: public sprout::false_type
{};
template<typename T>
struct is_trivially_assignable<T&, T>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_assignable<T&, T&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_assignable<T&, T const&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_assignable<T&, T&&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_assignable<T&, T const&&>
: public sprout::is_scalar<T>
{};
#endif // #if SPROUT_CLANG_HAS_FUTURE(is_trivially_assignable)
#else // #if !defined(_LIBCPP_VERSION)
template<typename T, typename U>
struct is_trivially_assignable
: public sprout::detail::type_traits_wrapper<std::is_trivially_assignable<T, U> >
{};
#endif // #if !defined(_LIBCPP_VERSION)
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename U>
SPROUT_STATIC_CONSTEXPR bool is_trivially_assignable_v = sprout::is_trivially_assignable<T, U>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_ASSIGNABLE_HPP

View file

@ -0,0 +1,74 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/detail/predef.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/is_scalar.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_trivially_constructible
//
#if !defined(_LIBCPP_VERSION)
#if SPROUT_CLANG_HAS_FUTURE(is_trivially_constructible)
template<typename T, typename... Args>
struct is_trivially_constructible
: public sprout::bool_constant<__is_trivially_constructible(T, Args...)>
{};
#else // #if SPROUT_CLANG_HAS_FUTURE(is_trivially_constructible)
template<typename T, typename... Args>
struct is_trivially_constructible
: public sprout::false_type
{};
#if SPROUT_CLANG_HAS_FUTURE(has_trivial_constructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
template<typename T>
struct is_trivially_constructible<T>
: public sprout::bool_constant<__has_trivial_constructor(T)>
{};
#else // #if SPROUT_CLANG_HAS_FUTURE(has_trivial_constructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
template<typename T>
struct is_trivially_constructible<T>
: public sprout::is_scalar<T>
{};
#endif // #if SPROUT_CLANG_HAS_FUTURE(has_trivial_constructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
template<typename T>
struct is_trivially_constructible<T, T&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_constructible<T, T const&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_constructible<T, T&&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_constructible<T, T const&&>
: public sprout::is_scalar<T>
{};
#endif // #if SPROUT_CLANG_HAS_FUTURE(is_trivially_constructible)
#else // #if !defined(_LIBCPP_VERSION)
template<typename T, typename... Args>
struct is_trivially_constructible
: public sprout::detail::type_traits_wrapper<std::is_trivially_constructible<T, Args...> >
{};
#endif // #if !defined(_LIBCPP_VERSION)
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T, typename... Args>
SPROUT_STATIC_CONSTEXPR bool is_trivially_constructible_v = sprout::is_trivially_constructible<T, Args...>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_CONSTRUCTIBLE_HPP

View file

@ -0,0 +1,40 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_HPP
#define SPROUT_TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_trivially_copy_assignable
//
#if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_copy_assignable
: public sprout::is_trivially_assignable<
typename std::add_lvalue_reference<T>::type,
typename std::add_lvalue_reference<T>::type const
>
{};
#else // #if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_copy_assignable
: public sprout::detail::type_traits_wrapper<std::is_trivially_copy_assignable<T> >
{};
#endif // #if !defined(_LIBCPP_VERSION)
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_copy_assignable_v = sprout::is_trivially_copy_assignable<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_COPY_ASSIGNABLE_HPP

View file

@ -0,0 +1,37 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_trivially_copy_constructible
//
#if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_copy_constructible
: public sprout::is_trivially_constructible<T, typename std::add_lvalue_reference<T>::type const>
{};
#else // #if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_copy_constructible
: public sprout::detail::type_traits_wrapper<std::is_trivially_copy_constructible<T> >
{};
#endif // #if !defined(_LIBCPP_VERSION)
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_copy_constructible_v = sprout::is_trivially_copy_constructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_COPY_CONSTRUCTIBLE_HPP

View file

@ -0,0 +1,38 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_HPP
#define SPROUT_TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/is_scalar.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_trivially_copyable
//
#if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_copyable
: public sprout::is_scalar<typename std::remove_all_extents<T>::type>
{};
#else
template<typename T>
struct is_trivially_copyable
: public sprout::detail::type_traits_wrapper<std::is_trivially_copyable<T> >
{};
#endif
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_copyable_v = sprout::is_trivially_copyable<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_COPYABLE_HPP

View file

@ -0,0 +1,37 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_trivially_default_constructible
//
#if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_default_constructible
: public sprout::is_trivially_constructible<T>
{};
#else // #if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_default_constructible
: public sprout::detail::type_traits_wrapper<std::is_trivially_default_constructible<T> >
{};
#endif // #if !defined(_LIBCPP_VERSION)
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_default_constructible_v = sprout::is_trivially_default_constructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_DEFAULT_CONSTRUCTIBLE_HPP

View file

@ -0,0 +1,51 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/detail/predef.hpp>
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_trivially_destructible
//
#if !defined(_LIBCPP_VERSION) && SPROUT_GCC_EARLIER(4, 8, 0)
#if SPROUT_CLANG_HAS_FUTURE(has_trivial_destructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
template<typename T>
struct is_trivially_destructible
: public sprout::bool_constant<sprout::is_destructible<T>::value && __has_trivial_destructor(T)>
{};
#else // #if SPROUT_CLANG_HAS_FUTURE(has_trivial_destructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
template<typename T>
struct is_trivially_destructible
: public sprout::bool_constant<
sprout::is_destructible<T>::value
&& (std::is_scalar<typename std::remove_all_extents<T>::type>::value
|| std::is_reference<typename std::remove_all_extents<T>::type>::value
)
>
{};
#endif // #if SPROUT_CLANG_HAS_FUTURE(has_trivial_destructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
#else // #if !defined(_LIBCPP_VERSION) && SPROUT_GCC_EARLIER(4, 8, 0)
template<typename T>
struct is_trivially_destructible
: public sprout::detail::type_traits_wrapper<std::is_trivially_destructible<T> >
{};
#endif // #if !defined(_LIBCPP_VERSION) && SPROUT_GCC_EARLIER(4, 8, 0)
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_destructible_v = sprout::is_trivially_destructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_DESTRUCTIBLE_HPP

View file

@ -0,0 +1,40 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_HPP
#define SPROUT_TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_trivially_move_assignable
//
#if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_move_assignable
: public sprout::is_trivially_assignable<
typename std::add_lvalue_reference<T>::type,
typename std::add_rvalue_reference<T>::type
>
{};
#else // #if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_move_assignable
: public sprout::detail::type_traits_wrapper<std::is_trivially_move_assignable<T> >
{};
#endif // #if !defined(_LIBCPP_VERSION)
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_move_assignable_v = sprout::is_trivially_move_assignable<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_MOVE_ASSIGNABLE_HPP

View file

@ -0,0 +1,37 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_HPP
#define SPROUT_TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_trivially_move_constructible
//
#if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_move_constructible
: public sprout::is_trivially_constructible<T, typename std::add_rvalue_reference<T>::type>
{};
#else // #if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_move_constructible
: public sprout::detail::type_traits_wrapper<std::is_trivially_move_constructible<T> >
{};
#endif // #if !defined(_LIBCPP_VERSION)
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_move_constructible_v = sprout::is_trivially_move_constructible<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_TRIVIALLY_MOVE_CONSTRUCTIBLE_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_UNION_HPP
#define SPROUT_TYPE_TRAITS_IS_UNION_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_union
//
template<typename T>
struct is_union
: public sprout::detail::type_traits_wrapper<std::is_union<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_union_v = sprout::is_union<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_UNION_HPP

View file

@ -31,6 +31,11 @@ namespace sprout {
struct is_unsigned
: public sprout::detail::is_unsigned_impl<T>
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_unsigned_v = sprout::is_unsigned<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_UNSIGNED_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_VOID_HPP
#define SPROUT_TYPE_TRAITS_IS_VOID_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_void
//
template<typename T>
struct is_void
: public sprout::detail::type_traits_wrapper<std::is_void<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_void_v = sprout::is_void<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_VOID_HPP

View file

@ -0,0 +1,30 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_IS_VOLATILE_HPP
#define SPROUT_TYPE_TRAITS_IS_VOLATILE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// is_volatile
//
template<typename T>
struct is_volatile
: public sprout::detail::type_traits_wrapper<std::is_volatile<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_volatile_v = sprout::is_volatile<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_IS_VOLATILE_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_MAKE_SIGNED_HPP
#define SPROUT_TYPE_TRAITS_MAKE_SIGNED_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// make_signed
//
using std::make_signed;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using make_signed_t = typename sprout::make_signed<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_MAKE_SIGNED_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_MAKE_UNSIGNED_HPP
#define SPROUT_TYPE_TRAITS_MAKE_UNSIGNED_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// make_unsigned
//
using std::make_unsigned;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using make_unsigned_t = typename sprout::make_unsigned<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_MAKE_UNSIGNED_HPP

View file

@ -0,0 +1,31 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_RANK_HPP
#define SPROUT_TYPE_TRAITS_RANK_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
namespace sprout {
//
// rank
//
template<typename T>
struct rank
: public sprout::detail::type_traits_wrapper<std::rank<T> >
{};
#if SPROUT_USE_VARIABLE_TEMPLATES
template<typename T>
SPROUT_STATIC_CONSTEXPR std::size_t rank_v = sprout::rank<T>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_RANK_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_REMOVE_ALL_EXTENTS_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_ALL_EXTENTS_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// remove_all_extents
//
using std::remove_all_extents;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using remove_all_extents_t = typename sprout::remove_all_extents<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_REMOVE_ALL_EXTENTS_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_REMOVE_CONST_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_CONST_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// remove_const
//
using std::remove_const;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using remove_const_t = typename sprout::remove_const<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_REMOVE_CONST_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_REMOVE_CV_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_CONST_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// remove_cv
//
using std::remove_cv;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using remove_cv_t = typename sprout::remove_cv<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_REMOVE_CV_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_REMOVE_EXTENT_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_EXTENT_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// remove_extent
//
using std::remove_extent;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using remove_extent_t = typename sprout::remove_extent<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_REMOVE_EXTENT_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_REMOVE_POINTER_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_POINTER_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// remove_pointer
//
using std::remove_pointer;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using remove_pointer_t = typename sprout::remove_pointer<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_REMOVE_POINTER_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_REMOVE_REFERENCE_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_REFERENCE_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// remove_reference
//
using std::remove_reference;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using remove_reference_t = typename sprout::remove_reference<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_REMOVE_REFERENCE_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_REMOVE_VOLATILE_HPP
#define SPROUT_TYPE_TRAITS_REMOVE_VOLATILE_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// remove_volatile
//
using std::remove_volatile;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using remove_volatile_t = typename sprout::remove_volatile<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_REMOVE_VOLATILE_HPP

View file

@ -194,6 +194,11 @@ namespace sprout {
Functor, Args...
>
{};
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename F, typename... ArgTypes>
using result_of_t = typename sprout::result_of<F(ArgTypes...)>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_RESULT_OF_HPP

View file

@ -1,4 +1,7 @@
/*=============================================================================
Copyright (c) 2011 osyo-manga
http://d.hatena.ne.jp/osyo-manga/
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
@ -9,82 +12,6 @@
#define SPROUT_TYPE_TRAITS_STD_TYPE_ALIASES_HPP
#include <sprout/config.hpp>
#if SPROUT_USE_TEMPLATE_ALIASES
# include <sprout/workaround/std/cstddef.hpp>
# include <sprout/type_traits/std_type_traits.hpp>
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
namespace sprout {
#if SPROUT_USE_TEMPLATE_ALIASES
// Copyright (c) 2011 osyo-manga : http://d.hatena.ne.jp/osyo-manga/
// 20.10.7.1 Const-volatile modifications
template<typename T>
using remove_const_t = typename sprout::remove_const<T>::type;
template<typename T>
using remove_volatile_t = typename sprout::remove_volatile<T>::type;
template<typename T>
using remove_cv_t = typename sprout::remove_cv<T>::type;
template<typename T>
using add_const_t = typename sprout::add_const<T>::type;
template<typename T>
using add_volatile_t = typename sprout::add_volatile<T>::type;
template<typename T>
using add_cv_t = typename sprout::add_cv<T>::type;
// 20.10.7.2 Reference modifications
template<typename T>
using remove_reference_t = typename sprout::remove_reference<T>::type;
template<typename T>
using add_lvalue_reference_t = typename sprout::add_lvalue_reference<T>::type;
template<typename T>
using add_rvalue_reference_t = typename sprout::add_rvalue_reference<T>::type;
// 20.10.7.3 Sign modifications
template<typename T>
using make_signed_t = typename sprout::make_signed<T>::type;
template<typename T>
using make_unsigned_t = typename sprout::make_unsigned<T>::type;
// 20.10.7.4 Array modifications
template<typename T>
using remove_extent_t = typename sprout::remove_extent<T>::type;
template<typename T>
using remove_all_extents_t = typename sprout::remove_all_extents<T>::type;
// 20.10.7.5 Pointer modifications
template<typename T>
using remove_pointer_t = typename sprout::remove_pointer<T>::type;
template<typename T>
using add_pointer_t = typename sprout::add_pointer<T>::type;
// 20.10.7.6 Other transformations
template<
std::size_t Len,
std::size_t Align = sprout::alignment_of<typename sprout::aligned_storage<Len>::type>::value
>
using aligned_storage_t = typename sprout::aligned_storage<Len, Align>::type;
template<std::size_t Len, typename... Types>
using aligned_union_t = typename sprout::aligned_union<Len, Types...>::type;
template<typename T>
using decay_t = typename sprout::decay<T>::type;
template<bool B, typename T = void>
using enable_if_t = typename sprout::enable_if<B, T>::type;
template<bool B, typename T, typename F>
using conditional_t = typename sprout::conditional<B, T, F>::type;
// template<typename... Types>
// using common_type_t = typename sprout::common_type<Types...>::type;
template<typename T>
using underlying_type_t = typename sprout::underlying_type<T>::type;
template<typename F, typename... ArgTypes>
using result_of_t = typename sprout::result_of<F(ArgTypes...)>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#include <sprout/type_traits/std_type_traits.hpp>
#endif // #ifndef SPROUT_TYPE_TRAITS_STD_TYPE_ALIASES_HPP

View file

@ -8,466 +8,107 @@
#ifndef SPROUT_TYPE_TRAITS_STD_TYPE_TRAITS_HPP
#define SPROUT_TYPE_TRAITS_STD_TYPE_TRAITS_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/detail/predef.hpp>
// 20.10.3, helper class:
#include <sprout/type_traits/integral_constant.hpp>
#include <sprout/type_traits/common_type.hpp>
// 20.10.4.1, primary type categories:
#include <sprout/type_traits/is_void.hpp>
#include <sprout/type_traits/is_null_pointer.hpp>
#include <sprout/type_traits/is_integral.hpp>
#include <sprout/type_traits/is_floating_point.hpp>
#include <sprout/type_traits/is_array.hpp>
#include <sprout/type_traits/is_pointer.hpp>
#include <sprout/type_traits/is_lvalue_reference.hpp>
#include <sprout/type_traits/is_rvalue_reference.hpp>
#include <sprout/type_traits/is_member_object_pointer.hpp>
#include <sprout/type_traits/is_member_function_pointer.hpp>
#include <sprout/type_traits/is_enum.hpp>
#include <sprout/type_traits/is_union.hpp>
#include <sprout/type_traits/is_class.hpp>
#include <sprout/type_traits/is_function.hpp>
// 20.10.4.2 Composite type traits
#include <sprout/type_traits/is_reference.hpp>
#include <sprout/type_traits/is_arithmetic.hpp>
#include <sprout/type_traits/is_fundamental.hpp>
#include <sprout/type_traits/is_object.hpp>
#include <sprout/type_traits/is_scalar.hpp>
#include <sprout/type_traits/is_compound.hpp>
#include <sprout/type_traits/is_member_pointer.hpp>
// 20.10.4.3 Type properties
#include <sprout/type_traits/is_const.hpp>
#include <sprout/type_traits/is_volatile.hpp>
#include <sprout/type_traits/is_trivial.hpp>
#include <sprout/type_traits/is_trivially_copyable.hpp>
#include <sprout/type_traits/is_standard_layout.hpp>
#include <sprout/type_traits/is_pod.hpp>
#include <sprout/type_traits/is_literal_type.hpp>
#include <sprout/type_traits/is_empty.hpp>
#include <sprout/type_traits/is_polymorphic.hpp>
#include <sprout/type_traits/is_abstract.hpp>
#include <sprout/type_traits/is_final.hpp>
#include <sprout/type_traits/is_signed.hpp>
#include <sprout/type_traits/is_unsigned.hpp>
#include <sprout/type_traits/is_constructible.hpp>
#include <sprout/type_traits/is_default_constructible.hpp>
#include <sprout/type_traits/is_copy_constructible.hpp>
#include <sprout/type_traits/is_move_constructible.hpp>
#include <sprout/type_traits/is_assignable.hpp>
#include <sprout/type_traits/is_copy_assignable.hpp>
#include <sprout/type_traits/is_move_assignable.hpp>
#include <sprout/type_traits/is_destructible.hpp>
#include <sprout/type_traits/is_trivially_constructible.hpp>
#include <sprout/type_traits/is_trivially_default_constructible.hpp>
#include <sprout/type_traits/is_trivially_copy_constructible.hpp>
#include <sprout/type_traits/is_trivially_move_constructible.hpp>
#include <sprout/type_traits/is_trivially_assignable.hpp>
#include <sprout/type_traits/is_trivially_copy_assignable.hpp>
#include <sprout/type_traits/is_trivially_move_assignable.hpp>
#include <sprout/type_traits/is_trivially_destructible.hpp>
#include <sprout/type_traits/is_nothrow_constructible.hpp>
#include <sprout/type_traits/is_nothrow_default_constructible.hpp>
#include <sprout/type_traits/is_nothrow_copy_constructible.hpp>
#include <sprout/type_traits/is_nothrow_move_constructible.hpp>
#include <sprout/type_traits/is_nothrow_assignable.hpp>
#include <sprout/type_traits/is_nothrow_copy_assignable.hpp>
#include <sprout/type_traits/is_nothrow_move_assignable.hpp>
#include <sprout/type_traits/is_nothrow_destructible.hpp>
#include <sprout/type_traits/has_virtual_destructor.hpp>
// 20.10.5 Type property queries
#include <sprout/type_traits/alignment_of.hpp>
#include <sprout/type_traits/rank.hpp>
#include <sprout/type_traits/extent.hpp>
// 20.10.6 Relationships between types
#include <sprout/type_traits/is_same.hpp>
#include <sprout/type_traits/is_base_of.hpp>
#include <sprout/type_traits/is_convertible.hpp>
// 20.10.7.1 Const-volatile modifications
#include <sprout/type_traits/remove_const.hpp>
#include <sprout/type_traits/remove_volatile.hpp>
#include <sprout/type_traits/remove_cv.hpp>
#include <sprout/type_traits/add_const.hpp>
#include <sprout/type_traits/add_volatile.hpp>
#include <sprout/type_traits/add_cv.hpp>
// 20.10.7.2 Reference modifications
#include <sprout/type_traits/remove_reference.hpp>
#include <sprout/type_traits/add_lvalue_reference.hpp>
#include <sprout/type_traits/add_rvalue_reference.hpp>
// 20.10.7.3 Sign modifications
#include <sprout/type_traits/make_signed.hpp>
#include <sprout/type_traits/make_unsigned.hpp>
// 20.10.7.4 Array modifications
#include <sprout/type_traits/remove_extent.hpp>
#include <sprout/type_traits/remove_all_extents.hpp>
// 20.10.7.5 Pointer modifications
#include <sprout/type_traits/remove_pointer.hpp>
#include <sprout/type_traits/add_pointer.hpp>
// 20.10.7.6 Other transformations
#include <sprout/type_traits/aligned_storage.hpp>
#include <sprout/type_traits/aligned_union.hpp>
#include <sprout/type_traits/decay.hpp>
#include <sprout/type_traits/enable_if.hpp>
#include <sprout/type_traits/conditional.hpp>
#include <sprout/type_traits/common_type.hpp>
#include <sprout/type_traits/underlying_type.hpp>
#include <sprout/type_traits/result_of.hpp>
#include <sprout/type_traits/is_null_pointer.hpp>
#include <sprout/type_traits/detail/type_traits_wrapper.hpp>
#if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)
# include <sprout/tpp/algorithm/max_element.hpp>
#endif
namespace sprout {
// 20.10.4.1 Primary type categories
template<typename T>
struct is_void
: public sprout::detail::type_traits_wrapper<std::is_void<T> >
{};
template<typename T>
struct is_integral
: public sprout::detail::type_traits_wrapper<std::is_integral<T> >
{};
template<typename T>
struct is_floating_point
: public sprout::detail::type_traits_wrapper<std::is_floating_point<T> >
{};
template<typename T>
struct is_array
: public sprout::detail::type_traits_wrapper<std::is_array<T> >
{};
template<typename T>
struct is_pointer
: public sprout::detail::type_traits_wrapper<std::is_pointer<T> >
{};
template<typename T>
struct is_lvalue_reference
: public sprout::detail::type_traits_wrapper<std::is_lvalue_reference<T> >
{};
template<typename T>
struct is_rvalue_reference
: public sprout::detail::type_traits_wrapper<std::is_rvalue_reference<T> >
{};
template<typename T>
struct is_member_object_pointer
: public sprout::detail::type_traits_wrapper<std::is_member_object_pointer<T> >
{};
template<typename T>
struct is_member_function_pointer
: public sprout::detail::type_traits_wrapper<std::is_member_function_pointer<T> >
{};
template<typename T>
struct is_enum
: public sprout::detail::type_traits_wrapper<std::is_enum<T> >
{};
template<typename T>
struct is_union
: public sprout::detail::type_traits_wrapper<std::is_union<T> >
{};
template<typename T>
struct is_class
: public sprout::detail::type_traits_wrapper<std::is_class<T> >
{};
template<typename T>
struct is_function
: public sprout::detail::type_traits_wrapper<std::is_function<T> >
{};
// 20.10.4.2 Composite type traits
template<typename T>
struct is_reference
: public sprout::detail::type_traits_wrapper<std::is_reference<T> >
{};
template<typename T>
struct is_arithmetic
: public sprout::detail::type_traits_wrapper<std::is_arithmetic<T> >
{};
template<typename T>
struct is_fundamental
: public sprout::detail::type_traits_wrapper<std::is_fundamental<T> >
{};
template<typename T>
struct is_object
: public sprout::detail::type_traits_wrapper<std::is_object<T> >
{};
template<typename T>
struct is_scalar
: public sprout::detail::type_traits_wrapper<std::is_scalar<T> >
{};
template<typename T>
struct is_compound
: public sprout::detail::type_traits_wrapper<std::is_compound<T> >
{};
template<typename T>
struct is_member_pointer
: public sprout::detail::type_traits_wrapper<std::is_member_pointer<T> >
{};
// 20.10.4.3 Type properties
template<typename T>
struct is_const
: public sprout::detail::type_traits_wrapper<std::is_const<T> >
{};
template<typename T>
struct is_volatile
: public sprout::detail::type_traits_wrapper<std::is_volatile<T> >
{};
template<typename T>
struct is_trivial
: public sprout::detail::type_traits_wrapper<std::is_trivial<T> >
{};
#if !defined(_LIBCPP_VERSION)
template<typename T>
struct is_trivially_copyable
: public sprout::is_scalar<typename std::remove_all_extents<T>::type>
{};
#else
template<typename T>
struct is_trivially_copyable
: public sprout::detail::type_traits_wrapper<std::is_trivially_copyable<T> >
{};
#endif
template<typename T>
struct is_standard_layout
: public sprout::detail::type_traits_wrapper<std::is_standard_layout<T> >
{};
template<typename T>
struct is_pod
: public sprout::detail::type_traits_wrapper<std::is_pod<T> >
{};
template<typename T>
struct is_literal_type
: public sprout::detail::type_traits_wrapper<std::is_literal_type<T> >
{};
template<typename T>
struct is_empty
: public sprout::detail::type_traits_wrapper<std::is_empty<T> >
{};
template<typename T>
struct is_polymorphic
: public sprout::detail::type_traits_wrapper<std::is_polymorphic<T> >
{};
template<typename T>
struct is_abstract
: public sprout::detail::type_traits_wrapper<std::is_abstract<T> >
{};
// template<typename T>
// struct is_signed
// : public sprout::detail::type_traits_wrapper<std::is_signed<T> >
// {};
// template<typename T>
// struct is_unsigned
// : public sprout::detail::type_traits_wrapper<std::is_unsigned<T> >
// {};
template<typename T, typename... Args>
struct is_constructible
: public sprout::detail::type_traits_wrapper<std::is_constructible<T, Args...> >
{};
template<typename T>
struct is_default_constructible
: public sprout::detail::type_traits_wrapper<std::is_default_constructible<T> >
{};
template<typename T>
struct is_copy_constructible
: public sprout::detail::type_traits_wrapper<std::is_copy_constructible<T> >
{};
template<typename T>
struct is_move_constructible
: public sprout::detail::type_traits_wrapper<std::is_move_constructible<T> >
{};
template<typename T, typename U>
struct is_assignable
: public sprout::detail::type_traits_wrapper<std::is_assignable<T, U> >
{};
template<typename T>
struct is_copy_assignable
: public sprout::detail::type_traits_wrapper<std::is_copy_assignable<T> >
{};
template<typename T>
struct is_move_assignable
: public sprout::detail::type_traits_wrapper<std::is_move_assignable<T> >
{};
// template<typename T>
// struct is_destructible
// : public sprout::detail::type_traits_wrapper<std::is_destructible<T> >
// {};
#if !defined(_LIBCPP_VERSION)
#if SPROUT_CLANG_HAS_FUTURE(is_trivially_constructible)
template<typename T, typename... Args>
struct is_trivially_constructible
: public sprout::bool_constant<__is_trivially_constructible(T, Args...)>
{};
#else // #if SPROUT_CLANG_HAS_FUTURE(is_trivially_constructible)
template<typename T, typename... Args>
struct is_trivially_constructible
: public sprout::false_type
{};
#if SPROUT_CLANG_HAS_FUTURE(has_trivial_constructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
template<typename T>
struct is_trivially_constructible<T>
: public sprout::bool_constant<__has_trivial_constructor(T)>
{};
#else // #if SPROUT_CLANG_HAS_FUTURE(has_trivial_constructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
template<typename T>
struct is_trivially_constructible<T>
: public sprout::is_scalar<T>
{};
#endif // #if SPROUT_CLANG_HAS_FUTURE(has_trivial_constructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
template<typename T>
struct is_trivially_constructible<T, T&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_constructible<T, T const&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_constructible<T, T&&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_constructible<T, T const&&>
: public sprout::is_scalar<T>
{};
#endif // #if SPROUT_CLANG_HAS_FUTURE(is_trivially_constructible)
template<typename T>
struct is_trivially_default_constructible
: public sprout::is_trivially_constructible<T>
{};
template<typename T>
struct is_trivially_copy_constructible
: public sprout::is_trivially_constructible<T, typename std::add_lvalue_reference<T>::type const>
{};
template<typename T>
struct is_trivially_move_constructible
: public sprout::is_trivially_constructible<T, typename std::add_rvalue_reference<T>::type const>
{};
#if SPROUT_CLANG_HAS_FUTURE(is_trivially_assignable)
template<typename T, typename U>
struct is_trivially_assignable
: public sprout::bool_constant<__is_trivially_assignable(T, U)>
{};
#else // #if SPROUT_CLANG_HAS_FUTURE(is_trivially_assignable)
template<typename T, typename U>
struct is_trivially_assignable
: public sprout::false_type
{};
template<typename T>
struct is_trivially_assignable<T&, T>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_assignable<T&, T&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_assignable<T&, T const&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_assignable<T&, T&&>
: public sprout::is_scalar<T>
{};
template<typename T>
struct is_trivially_assignable<T&, T const&&>
: public sprout::is_scalar<T>
{};
#endif // #if SPROUT_CLANG_HAS_FUTURE(is_trivially_assignable)
template<typename T>
struct is_trivially_copy_assignable
: public sprout::is_trivially_assignable<
typename std::add_lvalue_reference<T>::type,
typename std::add_lvalue_reference<T>::type const
>
{};
template<typename T>
struct is_trivially_move_assignable
: public sprout::is_trivially_assignable<
typename std::add_lvalue_reference<T>::type,
typename std::add_rvalue_reference<T>::type
>
{};
#else // #if !defined(_LIBCPP_VERSION)
template<typename T, typename... Args>
struct is_trivially_constructible
: public sprout::detail::type_traits_wrapper<std::is_trivially_constructible<T, Args...> >
{};
template<typename T>
struct is_trivially_default_constructible
: public sprout::detail::type_traits_wrapper<std::is_trivially_default_constructible<T> >
{};
template<typename T>
struct is_trivially_copy_constructible
: public sprout::detail::type_traits_wrapper<std::is_trivially_copy_constructible<T> >
{};
template<typename T>
struct is_trivially_move_constructible
: public sprout::detail::type_traits_wrapper<std::is_trivially_move_constructible<T> >
{};
template<typename T, typename U>
struct is_trivially_assignable
: public sprout::detail::type_traits_wrapper<std::is_trivially_assignable<T, U> >
{};
template<typename T>
struct is_trivially_copy_assignable
: public sprout::detail::type_traits_wrapper<std::is_trivially_copy_assignable<T> >
{};
template<typename T>
struct is_trivially_move_assignable
: public sprout::detail::type_traits_wrapper<std::is_trivially_move_assignable<T> >
{};
#endif // #if !defined(_LIBCPP_VERSION)
#if !defined(_LIBCPP_VERSION) && SPROUT_GCC_EARLIER(4, 8, 0)
#if SPROUT_CLANG_HAS_FUTURE(has_trivial_destructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
template<typename T>
struct is_trivially_destructible
: public sprout::bool_constant<sprout::is_destructible<T>::value && __has_trivial_destructor(T)>
{};
#else // #if SPROUT_CLANG_HAS_FUTURE(has_trivial_destructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
template<typename T>
struct is_trivially_destructible
: public sprout::bool_constant<
sprout::is_destructible<T>::value
&& (std::is_scalar<typename std::remove_all_extents<T>::type>::value
|| std::is_reference<typename std::remove_all_extents<T>::type>::value
)
>
{};
#endif // #if SPROUT_CLANG_HAS_FUTURE(has_trivial_destructor) || SPROUT_GCC_OR_LATER(4, 3, 0)
#else // #if !defined(_LIBCPP_VERSION) && SPROUT_GCC_EARLIER(4, 8, 0)
template<typename T>
struct is_trivially_destructible
: public sprout::detail::type_traits_wrapper<std::is_trivially_destructible<T> >
{};
#endif // #if !defined(_LIBCPP_VERSION) && SPROUT_GCC_EARLIER(4, 8, 0)
template<typename T, typename... Args>
struct is_nothrow_constructible
: public sprout::detail::type_traits_wrapper<std::is_nothrow_constructible<T, Args...> >
{};
template<typename T>
struct is_nothrow_default_constructible
: public sprout::detail::type_traits_wrapper<std::is_nothrow_default_constructible<T> >
{};
template<typename T>
struct is_nothrow_copy_constructible
: public sprout::detail::type_traits_wrapper<std::is_nothrow_copy_constructible<T> >
{};
template<typename T>
struct is_nothrow_move_constructible
: public sprout::detail::type_traits_wrapper<std::is_nothrow_move_constructible<T> >
{};
template<typename T, typename U>
struct is_nothrow_assignable
: public sprout::detail::type_traits_wrapper<std::is_nothrow_assignable<T, U> >
{};
template<typename T>
struct is_nothrow_copy_assignable
: public sprout::detail::type_traits_wrapper<std::is_nothrow_copy_assignable<T> >
{};
template<typename T>
struct is_nothrow_move_assignable
: public sprout::detail::type_traits_wrapper<std::is_nothrow_move_assignable<T> >
{};
// template<typename T>
// struct is_nothrow_destructible
// : public sprout::detail::type_traits_wrapper<std::is_nothrow_destructible<T> >
// {};
template<typename T>
struct has_virtual_destructor
: public sprout::detail::type_traits_wrapper<std::has_virtual_destructor<T> >
{};
// 20.10.5 Type property queries
template<typename T>
struct alignment_of
: public sprout::detail::type_traits_wrapper<std::alignment_of<T> >
{};
template<typename T>
struct rank
: public sprout::detail::type_traits_wrapper<std::rank<T> >
{};
template<typename T, unsigned I = 0>
struct extent
: public sprout::detail::type_traits_wrapper<std::extent<T, I> >
{};
// 20.10.6 Relationships between types
template<typename T, typename U>
struct is_same
: public sprout::detail::type_traits_wrapper<std::is_same<T, U> >
{};
template<typename From, typename To>
struct is_base_of
: public sprout::detail::type_traits_wrapper<std::is_base_of<From, To> >
{};
template<typename From, typename To>
struct is_convertible
: public sprout::detail::type_traits_wrapper<std::is_convertible<From, To> >
{};
// 20.10.7.1 Const-volatile modifications
using std::remove_const;
using std::remove_volatile;
using std::remove_cv;
using std::add_const;
using std::add_volatile;
using std::add_cv;
// 20.10.7.2 Reference modifications
using std::remove_reference;
using std::add_lvalue_reference;
using std::add_rvalue_reference;
// 20.10.7.3 Sign modifications
using std::make_signed;
using std::make_unsigned;
// 20.10.7.4 Array modifications
using std::remove_extent;
using std::remove_all_extents;
// 20.10.7.5 Pointer modifications
using std::remove_pointer;
using std::add_pointer;
// 20.10.7.6 Other transformations
using std::aligned_storage;
#if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)
template<std::size_t Len, typename... Types>
struct aligned_union
: public std::aligned_storage<
sprout::tpp::max_element_c<std::size_t, Len, sizeof(Types)...>::value,
sprout::tpp::max_element_c<std::size_t, std::alignment_of<Types>::value...>::value
>
{};
#else // #if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)
using std::aligned_union;
#endif // #if !defined(_LIBCPP_VERSION) || (_LIBCPP_VERSION < 1101)
using std::decay;
using std::enable_if;
using std::conditional;
// using std::common_type;
using std::underlying_type;
// using std::result_of;
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_STD_TYPE_TRAITS_HPP

View file

@ -9,154 +9,6 @@
#define SPROUT_TYPE_TRAITS_STD_VALUE_VARIABLES_HPP
#include <sprout/config.hpp>
#if SPROUT_USE_VARIABLE_TEMPLATES
# include <sprout/workaround/std/cstddef.hpp>
# include <sprout/type_traits/std_type_traits.hpp>
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
namespace sprout {
#if SPROUT_USE_VARIABLE_TEMPLATES
// 20.10.4.1 Primary type categories
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_void_v = sprout::is_void<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_integral_v = sprout::is_integral<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_floating_point_v = sprout::is_floating_point<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_array_v = sprout::is_array<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_pointer_v = sprout::is_pointer<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_lvalue_reference_v = sprout::is_lvalue_reference<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_rvalue_reference_v = sprout::is_rvalue_reference<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_member_object_pointer_v = sprout::is_member_object_pointer<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_member_function_pointer_v = sprout::is_member_function_pointer<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_enum_v = sprout::is_enum<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_union_v = sprout::is_union<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_class_v = sprout::is_class<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_function_v = sprout::is_function<T>::value;
// 20.10.4.2 Composite type traits
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_reference_v = sprout::is_reference<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_arithmetic_v = sprout::is_arithmetic<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_fundamental_v = sprout::is_fundamental<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_object_v = sprout::is_object<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_scalar_v = sprout::is_scalar<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_compound_v = sprout::is_compound<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_member_pointer_v = sprout::is_member_pointer<T>::value;
// 20.10.4.3 Type properties
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_const_v = sprout::is_const<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_volatile_v = sprout::is_volatile<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivial_v = sprout::is_trivial<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_copyable_v = sprout::is_trivially_copyable<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_standard_layout_v = sprout::is_standard_layout<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_pod_v = sprout::is_pod<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_literal_type_v = sprout::is_literal_type<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_empty_v = sprout::is_empty<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_polymorphic_v = sprout::is_polymorphic<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_abstract_v = sprout::is_abstract<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_signed_v = sprout::is_signed<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_unsigned_v = sprout::is_unsigned<T>::value;
template<typename T, typename... Args>
SPROUT_STATIC_CONSTEXPR bool is_constructible_v = sprout::is_constructible<T, Args...>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_default_constructible_v = sprout::is_default_constructible<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_copy_constructible_v = sprout::is_copy_constructible<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_move_constructible_v = sprout::is_move_constructible<T>::value;
template<typename T, typename U>
SPROUT_STATIC_CONSTEXPR bool is_assignable_v = sprout::is_assignable<T, U>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_copy_assignable_v = sprout::is_copy_assignable<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_move_assignable_v = sprout::is_move_assignable<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_destructible_v = sprout::is_destructible<T>::value;
template<typename T, typename... Args>
SPROUT_STATIC_CONSTEXPR bool is_trivially_constructible_v = sprout::is_trivially_constructible<T, Args...>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_default_constructible_v = sprout::is_trivially_default_constructible<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_copy_constructible_v = sprout::is_trivially_copy_constructible<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_move_constructible_v = sprout::is_trivially_move_constructible<T>::value;
template<typename T, typename U>
SPROUT_STATIC_CONSTEXPR bool is_trivially_assignable_v = sprout::is_trivially_assignable<T, U>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_copy_assignable_v = sprout::is_trivially_copy_assignable<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_move_assignable_v = sprout::is_trivially_move_assignable<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_trivially_destructible_v = sprout::is_trivially_destructible<T>::value;
template<typename T, typename... Args>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_constructible_v = sprout::is_nothrow_constructible<T, Args...>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_default_constructible_v = sprout::is_nothrow_default_constructible<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_copy_constructible_v = sprout::is_nothrow_copy_constructible<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_move_constructible_v = sprout::is_nothrow_move_constructible<T>::value;
template<typename T, typename U>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_assignable_v = sprout::is_nothrow_assignable<T, U>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_copy_assignable_v = sprout::is_nothrow_copy_assignable<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_move_assignable_v = sprout::is_nothrow_move_assignable<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool is_nothrow_destructible_v = sprout::is_nothrow_destructible<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR bool has_virtual_destructor_v = sprout::has_virtual_destructor<T>::value;
// 20.10.5 Type property queries
template<typename T>
SPROUT_STATIC_CONSTEXPR std::size_t alignment_of_v = sprout::alignment_of<T>::value;
template<typename T>
SPROUT_STATIC_CONSTEXPR std::size_t rank_v = sprout::rank<T>::value;
template<typename T, unsigned I = 0>
SPROUT_STATIC_CONSTEXPR std::size_t extent_v = sprout::extent<T, I>::value;
// 20.10.6 Relationships between types
template<typename T, typename U>
SPROUT_STATIC_CONSTEXPR bool is_same_v = sprout::is_same<T, U>::value;
template<typename From, typename To>
SPROUT_STATIC_CONSTEXPR bool is_base_of_v = sprout::is_base_of<From, To>::value;
template<typename From, typename To>
SPROUT_STATIC_CONSTEXPR bool is_convertible_v = sprout::is_convertible<From, To>::value;
#endif // #if SPROUT_USE_VARIABLE_TEMPLATES
} // namespace sprout
#include <sprout/type_traits/std_type_traits.hpp>
#endif // #ifndef SPROUT_TYPE_TRAITS_STD_VALUE_VARIABLES_HPP

View file

@ -0,0 +1,26 @@
/*=============================================================================
Copyright (c) 2011-2015 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_TYPE_TRAITS_UNDERLYING_TYPE_HPP
#define SPROUT_TYPE_TRAITS_UNDERLYING_TYPE_HPP
#include <type_traits>
#include <sprout/config.hpp>
namespace sprout {
//
// underlying_type
//
using std::underlying_type;
#if SPROUT_USE_TEMPLATE_ALIASES
template<typename T>
using underlying_type_t = typename sprout::underlying_type<T>::type;
#endif // #if SPROUT_USE_TEMPLATE_ALIASES
} // namespace sprout
#endif // #ifndef SPROUT_TYPE_TRAITS_UNDERLYING_TYPE_HPP