mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
all type_traits support C++14 requirements
This commit is contained in:
parent
bf0c7021cf
commit
403e83eaf0
95 changed files with 319 additions and 268 deletions
|
@ -8,8 +8,8 @@
|
|||
#ifndef SPROUT_DETAIL_DIGITS_TO_INT_HPP
|
||||
#define SPROUT_DETAIL_DIGITS_TO_INT_HPP
|
||||
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/type_traits/integral_constant.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace detail {
|
||||
|
@ -17,11 +17,11 @@ namespace sprout {
|
|||
struct digits_to_int;
|
||||
template<typename IntType, char C>
|
||||
struct digits_to_int<IntType, C>
|
||||
: public std::integral_constant<IntType, IntType(C - 48)>
|
||||
: public sprout::integral_constant<IntType, IntType(C - 48)>
|
||||
{};
|
||||
template<typename IntType, char Head, char... Tail>
|
||||
struct digits_to_int<IntType, Head, Tail...>
|
||||
: public std::integral_constant<IntType, 10 * IntType(Head - 48) + sprout::detail::digits_to_int<IntType, Tail...>::value>
|
||||
: public sprout::integral_constant<IntType, 10 * IntType(Head - 48) + sprout::detail::digits_to_int<IntType, Tail...>::value>
|
||||
{};
|
||||
} // namespace detail
|
||||
} // namespace sprout
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#define SPROUT_DETAIL_INTEGER_STATIC_LOG2_HPP
|
||||
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/type_traits/integral_constant.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace detail {
|
||||
|
@ -58,7 +58,7 @@ namespace sprout {
|
|||
|
||||
template<sprout::detail::static_log2_argument_type x>
|
||||
struct static_log2
|
||||
: public std::integral_constant<
|
||||
: public sprout::integral_constant<
|
||||
sprout::detail::static_log2_result_type,
|
||||
sprout::detail::static_log2_impl::static_log2_impl<x>::value
|
||||
>
|
||||
|
|
|
@ -11,12 +11,18 @@
|
|||
#include <cstddef>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/type_traits/integral_constant.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace detail {
|
||||
template<typename T>
|
||||
struct sizeof_
|
||||
: public sprout::integral_constant<std::size_t, sizeof(T)>
|
||||
{};
|
||||
|
||||
template<typename... Ts>
|
||||
struct sizeof_pack
|
||||
: public std::integral_constant<std::size_t, sizeof...(Ts)>
|
||||
: public sprout::integral_constant<std::size_t, sizeof...(Ts)>
|
||||
{};
|
||||
} // namespace detail
|
||||
} // namespace sprout
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue