mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-01-21 20:36:37 +00:00
fix for clang 3.2
This commit is contained in:
parent
3a999dd70c
commit
b67695ec6b
28 changed files with 133 additions and 75 deletions
|
@ -239,8 +239,14 @@ namespace sprout {
|
||||||
// make_common_array
|
// make_common_array
|
||||||
//
|
//
|
||||||
template<typename... Types>
|
template<typename... Types>
|
||||||
inline SPROUT_CONSTEXPR sprout::array<typename std::common_type<typename std::decay<Types>::type...>::type, sizeof...(Types)> make_common_array(Types&&... args) {
|
inline SPROUT_CONSTEXPR sprout::array<
|
||||||
return sprout::array<typename std::common_type<typename std::decay<Types>::type...>::type, sizeof...(Types)>{{sprout::forward<Types>(args)...}};
|
typename std::decay<typename std::common_type<typename std::decay<Types>::type...>::type>::type,
|
||||||
|
sizeof...(Types)
|
||||||
|
> make_common_array(Types&&... args) {
|
||||||
|
return sprout::array<
|
||||||
|
typename std::decay<typename std::common_type<typename std::decay<Types>::type...>::type>::type,
|
||||||
|
sizeof...(Types)
|
||||||
|
>{{sprout::forward<Types>(args)...}};
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
|
@ -287,7 +293,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename T, std::size_t N>
|
template<typename T, std::size_t N>
|
||||||
struct tuple_size<sprout::array<T, N> >
|
class tuple_size<sprout::array<T, N> >
|
||||||
: public std::integral_constant<std::size_t, N>
|
: public std::integral_constant<std::size_t, N>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -295,7 +301,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename T, std::size_t N>
|
template<std::size_t I, typename T, std::size_t N>
|
||||||
struct tuple_element<I, sprout::array<T, N> > {
|
class tuple_element<I, sprout::array<T, N> > {
|
||||||
public:
|
public:
|
||||||
static_assert(I < N, "tuple_element<>: index out of range");
|
static_assert(I < N, "tuple_element<>: index out of range");
|
||||||
typedef T type;
|
typedef T type;
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
# ifndef SPROUT_HAS_CONSTEXPR_CMATH_FUNCTION
|
# ifndef SPROUT_HAS_CONSTEXPR_CMATH_FUNCTION
|
||||||
# define SPROUT_CONFIG_DISABLE_BUILTIN_CMATH_FUNCTION
|
# define SPROUT_CONFIG_DISABLE_BUILTIN_CMATH_FUNCTION
|
||||||
# endif // #ifdef SPROUT_HAS_CONSTEXPR_CMATH_FUNCTION
|
# endif // #ifdef SPROUT_HAS_CONSTEXPR_CMATH_FUNCTION
|
||||||
#endif // #ifndef SPROUT_CONFIG_DISABLE_SUPPORT_TEMPORARY_CONTAINER_ITERATION
|
#endif // #ifndef SPROUT_CONFIG_DISABLE_BUILTIN_CMATH_FUNCTION
|
||||||
|
|
||||||
//
|
//
|
||||||
// SPROUT_CONFIG_DISABLE_SUPPORT_TEMPORARY_CONTAINER_ITERATION
|
// SPROUT_CONFIG_DISABLE_SUPPORT_TEMPORARY_CONTAINER_ITERATION
|
||||||
|
|
|
@ -148,10 +148,11 @@ namespace sprout {
|
||||||
SPROUT_CONSTEXPR std::size_t hash_value(T* v) {
|
SPROUT_CONSTEXPR std::size_t hash_value(T* v) {
|
||||||
return sprout::hash_detail::hash_value_pointer(v);
|
return sprout::hash_detail::hash_value_pointer(v);
|
||||||
}
|
}
|
||||||
template<typename T, std::size_t N >
|
// !!!
|
||||||
SPROUT_CONSTEXPR std::size_t hash_value(T const (&v)[N]) {
|
// template<typename T, std::size_t N>
|
||||||
return sprout::hash_range(&v[0], &v[0] + N);
|
// SPROUT_CONSTEXPR std::size_t hash_value(T const (&v)[N]) {
|
||||||
}
|
// return sprout::hash_range(&v[0], &v[0] + N);
|
||||||
|
// }
|
||||||
|
|
||||||
//
|
//
|
||||||
// to_hash
|
// to_hash
|
||||||
|
@ -161,6 +162,10 @@ namespace sprout {
|
||||||
using sprout::hash_value;
|
using sprout::hash_value;
|
||||||
return hash_value(v);
|
return hash_value(v);
|
||||||
}
|
}
|
||||||
|
template<typename T, std::size_t N>
|
||||||
|
SPROUT_CONSTEXPR std::size_t to_hash(T const (&v)[N]) {
|
||||||
|
return sprout::hash_range(&v[0], &v[0] + N);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// hash_combine
|
// hash_combine
|
||||||
|
|
|
@ -654,7 +654,7 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<
|
template<
|
||||||
std::size_t I, typename Left, typename Right,
|
std::size_t I, typename Left, typename Right,
|
||||||
typename sprout::enabler_if<(I >= sprout::io::leaf_count<Left>::value)>::type = sprout::enabler
|
typename sprout::enabler_if<(I >= sprout::io::leaf_count<Left>::value)>::type
|
||||||
>
|
>
|
||||||
inline SPROUT_CONSTEXPR sprout::io::format_holder<
|
inline SPROUT_CONSTEXPR sprout::io::format_holder<
|
||||||
typename sprout::io::leaf_at<I, sprout::io::format_expression<Left, Right> >::type
|
typename sprout::io::leaf_at<I, sprout::io::format_expression<Left, Right> >::type
|
||||||
|
@ -777,7 +777,7 @@ namespace sprout {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
template<std::size_t N, typename Elem = char, typename Expression>
|
template<std::size_t N, typename Elem, typename Expression>
|
||||||
inline SPROUT_CONSTEXPR sprout::basic_string<Elem, N>
|
inline SPROUT_CONSTEXPR sprout::basic_string<Elem, N>
|
||||||
output(Expression const& expr) {
|
output(Expression const& expr) {
|
||||||
return sprout::io::detail::output<Elem, N>(
|
return sprout::io::detail::output<Elem, N>(
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace sprout {
|
||||||
return !(lhs == rhs);
|
return !(lhs == rhs);
|
||||||
}
|
}
|
||||||
friend SPROUT_CONSTEXPR bool operator<(bytes_iterator const& lhs, bytes_iterator const& rhs) {
|
friend SPROUT_CONSTEXPR bool operator<(bytes_iterator const& lhs, bytes_iterator const& rhs) {
|
||||||
return lhs.it_ < rhs.it_ || lhs.it_ == rhs.it_ && lhs.i_ < rhs.i_;
|
return lhs.it_ < rhs.it_ || (lhs.it_ == rhs.it_ && lhs.i_ < rhs.i_);
|
||||||
}
|
}
|
||||||
friend SPROUT_CONSTEXPR bool operator>(bytes_iterator const& lhs, bytes_iterator const& rhs) {
|
friend SPROUT_CONSTEXPR bool operator>(bytes_iterator const& lhs, bytes_iterator const& rhs) {
|
||||||
return rhs < lhs;
|
return rhs < lhs;
|
||||||
|
|
|
@ -35,7 +35,12 @@ namespace sprout {
|
||||||
iterator_type deref_tmp;
|
iterator_type deref_tmp;
|
||||||
public:
|
public:
|
||||||
reverse_iterator() = default;
|
reverse_iterator() = default;
|
||||||
reverse_iterator(reverse_iterator const&) = default;
|
// !!!
|
||||||
|
//reverse_iterator(reverse_iterator const&) = default;
|
||||||
|
SPROUT_CONSTEXPR reverse_iterator(reverse_iterator const& other)
|
||||||
|
: current(other.current)
|
||||||
|
, deref_tmp(other.deref_tmp)
|
||||||
|
{}
|
||||||
explicit SPROUT_CONSTEXPR reverse_iterator(iterator_type it)
|
explicit SPROUT_CONSTEXPR reverse_iterator(iterator_type it)
|
||||||
: current(it)
|
: current(it)
|
||||||
, deref_tmp(sprout::prev(it))
|
, deref_tmp(sprout::prev(it))
|
||||||
|
|
|
@ -217,7 +217,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
struct tuple_size<sprout::pit<Container> >
|
class tuple_size<sprout::pit<Container> >
|
||||||
: public std::tuple_size<Container>
|
: public std::tuple_size<Container>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename Container>
|
template<std::size_t I, typename Container>
|
||||||
struct tuple_element<I, sprout::pit<Container> >
|
class tuple_element<I, sprout::pit<Container> >
|
||||||
: public std::tuple_element<I, Container>
|
: public std::tuple_element<I, Container>
|
||||||
{};
|
{};
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename T, std::size_t N, typename Traits>
|
template<typename T, std::size_t N, typename Traits>
|
||||||
struct tuple_size<sprout::basic_string<T, N, Traits> >
|
class tuple_size<sprout::basic_string<T, N, Traits> >
|
||||||
: public std::integral_constant<std::size_t, N>
|
: public std::integral_constant<std::size_t, N>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename T, std::size_t N, typename Traits>
|
template<std::size_t I, typename T, std::size_t N, typename Traits>
|
||||||
struct tuple_element<I, sprout::basic_string<T, N, Traits> > {
|
class tuple_element<I, sprout::basic_string<T, N, Traits> > {
|
||||||
public:
|
public:
|
||||||
static_assert(I < N, "tuple_element<>: index out of range");
|
static_assert(I < N, "tuple_element<>: index out of range");
|
||||||
typedef T type;
|
typedef T type;
|
||||||
|
|
|
@ -854,7 +854,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename Container>
|
template<typename Container>
|
||||||
struct tuple_size<sprout::sub_array<Container> >
|
class tuple_size<sprout::sub_array<Container> >
|
||||||
: public std::tuple_size<typename std::remove_reference<Container>::type>
|
: public std::tuple_size<typename std::remove_reference<Container>::type>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -862,7 +862,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename Container>
|
template<std::size_t I, typename Container>
|
||||||
struct tuple_element<I, sprout::sub_array<Container> >
|
class tuple_element<I, sprout::sub_array<Container> >
|
||||||
: public std::tuple_element<I, typename std::remove_reference<Container>::type>
|
: public std::tuple_element<I, typename std::remove_reference<Container>::type>
|
||||||
{};
|
{};
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace sprout {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename T1, typename T2>
|
template<typename T1, typename T2>
|
||||||
struct tuple_size<sscrisk::cel::pair<T1, T2> >
|
class tuple_size<sscrisk::cel::pair<T1, T2> >
|
||||||
: public std::integral_constant<std::size_t, 2>
|
: public std::integral_constant<std::size_t, 2>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -22,20 +22,20 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<std::size_t I, typename T>
|
template<std::size_t I, typename T>
|
||||||
struct tuple_element_impl;
|
class tuple_element_impl;
|
||||||
template<typename T1, typename T2>
|
template<typename T1, typename T2>
|
||||||
struct tuple_element_impl<0, sscrisk::cel::pair<T1, T2> > {
|
class tuple_element_impl<0, sscrisk::cel::pair<T1, T2> > {
|
||||||
public:
|
public:
|
||||||
typedef T1 type;
|
typedef T1 type;
|
||||||
};
|
};
|
||||||
template<typename T1, typename T2>
|
template<typename T1, typename T2>
|
||||||
struct tuple_element_impl<1, sscrisk::cel::pair<T1, T2> > {
|
class tuple_element_impl<1, sscrisk::cel::pair<T1, T2> > {
|
||||||
public:
|
public:
|
||||||
typedef T2 type;
|
typedef T2 type;
|
||||||
};
|
};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
template<std::size_t I, typename T1, typename T2>
|
template<std::size_t I, typename T1, typename T2>
|
||||||
struct tuple_element<I, sscrisk::cel::pair<T1, T2> >
|
class tuple_element<I, sscrisk::cel::pair<T1, T2> >
|
||||||
: public sprout::tuples::detail::tuple_element_impl<I, sscrisk::cel::pair<T1, T2> >
|
: public sprout::tuples::detail::tuple_element_impl<I, sscrisk::cel::pair<T1, T2> >
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
|
|
@ -221,18 +221,50 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<bool Cond, typename... Tail>
|
template<bool Head, bool... Tail>
|
||||||
struct and_impl
|
struct and_impl;
|
||||||
|
template<>
|
||||||
|
struct and_impl<true>
|
||||||
|
: public std::true_type
|
||||||
|
{};
|
||||||
|
template<>
|
||||||
|
struct and_impl<false>
|
||||||
: public std::false_type
|
: public std::false_type
|
||||||
{};
|
{};
|
||||||
template<typename... Tail>
|
template<bool... Tail>
|
||||||
struct and_impl<true, Tail...>
|
struct and_impl<true, Tail...>
|
||||||
: public std::integral_constant<bool, sprout::tuples::detail::and_impl<Tail...>::value>
|
: public std::integral_constant<bool, sprout::tuples::detail::and_impl<Tail...>::value>
|
||||||
{};
|
{};
|
||||||
|
template<bool... Tail>
|
||||||
template<typename Head, typename... Tail>
|
struct and_impl<false, Tail...>
|
||||||
|
: public std::false_type
|
||||||
|
{};
|
||||||
|
template<typename... Types>
|
||||||
struct and_
|
struct and_
|
||||||
: public sprout::tuples::detail::and_impl<Head::value, Tail...>
|
: public sprout::tuples::detail::and_impl<Types::value...>
|
||||||
|
{};
|
||||||
|
|
||||||
|
template<bool Head, bool... Tail>
|
||||||
|
struct or_impl;
|
||||||
|
template<>
|
||||||
|
struct or_impl<true>
|
||||||
|
: public std::true_type
|
||||||
|
{};
|
||||||
|
template<>
|
||||||
|
struct or_impl<false>
|
||||||
|
: public std::false_type
|
||||||
|
{};
|
||||||
|
template<bool... Tail>
|
||||||
|
struct or_impl<true, Tail...>
|
||||||
|
: public std::true_type
|
||||||
|
{};
|
||||||
|
template<bool... Tail>
|
||||||
|
struct or_impl<false, Tail...>
|
||||||
|
: public std::integral_constant<bool, sprout::tuples::detail::or_impl<Tail...>::value>
|
||||||
|
{};
|
||||||
|
template<typename... Types>
|
||||||
|
struct or_
|
||||||
|
: public sprout::tuples::detail::and_impl<Types::value...>
|
||||||
{};
|
{};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
|
||||||
|
@ -384,14 +416,14 @@ namespace sprout {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<std::size_t I, typename T>
|
template<std::size_t I, typename T>
|
||||||
struct tuple_element_impl;
|
class tuple_element_impl;
|
||||||
template<typename Head, typename... Tail>
|
template<typename Head, typename... Tail>
|
||||||
struct tuple_element_impl<0, sprout::tuples::tuple<Head, Tail...> > {
|
class tuple_element_impl<0, sprout::tuples::tuple<Head, Tail...> > {
|
||||||
public:
|
public:
|
||||||
typedef Head type;
|
typedef Head type;
|
||||||
};
|
};
|
||||||
template<std::size_t I, typename Head, typename... Tail>
|
template<std::size_t I, typename Head, typename... Tail>
|
||||||
struct tuple_element_impl<I, sprout::tuples::tuple<Head, Tail...> >
|
class tuple_element_impl<I, sprout::tuples::tuple<Head, Tail...> >
|
||||||
: public sprout::tuples::detail::tuple_element_impl<I - 1, sprout::tuples::tuple<Tail...> >
|
: public sprout::tuples::detail::tuple_element_impl<I - 1, sprout::tuples::tuple<Tail...> >
|
||||||
{};
|
{};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
@ -410,7 +442,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename... Types>
|
template<typename... Types>
|
||||||
struct tuple_size<sprout::tuples::tuple<Types...> >
|
class tuple_size<sprout::tuples::tuple<Types...> >
|
||||||
: public std::integral_constant<std::size_t, sizeof...(Types)>
|
: public std::integral_constant<std::size_t, sizeof...(Types)>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -418,7 +450,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename... Types>
|
template<std::size_t I, typename... Types>
|
||||||
struct tuple_element<I, sprout::tuples::tuple<Types...> >
|
class tuple_element<I, sprout::tuples::tuple<Types...> >
|
||||||
: public sprout::tuples::detail::tuple_element_impl<I, sprout::tuples::tuple<Types...> >
|
: public sprout::tuples::detail::tuple_element_impl<I, sprout::tuples::tuple<Types...> >
|
||||||
{};
|
{};
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
@ -429,19 +461,19 @@ namespace sprout {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct tuple_size
|
class tuple_size
|
||||||
: public std::tuple_size<T>
|
: public std::tuple_size<T>
|
||||||
{};
|
{};
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct tuple_size<T const>
|
class tuple_size<T const>
|
||||||
: public sprout::tuples::tuple_size<T>
|
: public sprout::tuples::tuple_size<T>
|
||||||
{};
|
{};
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct tuple_size<T volatile>
|
class tuple_size<T volatile>
|
||||||
: public sprout::tuples::tuple_size<T>
|
: public sprout::tuples::tuple_size<T>
|
||||||
{};
|
{};
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct tuple_size<T const volatile>
|
class tuple_size<T const volatile>
|
||||||
: public sprout::tuples::tuple_size<T>
|
: public sprout::tuples::tuple_size<T>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -449,19 +481,19 @@ namespace sprout {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename T>
|
template<std::size_t I, typename T>
|
||||||
struct tuple_element
|
class tuple_element
|
||||||
: public std::tuple_element<I, T>
|
: public std::tuple_element<I, T>
|
||||||
{};
|
{};
|
||||||
template<std::size_t I, typename T>
|
template<std::size_t I, typename T>
|
||||||
struct tuple_element<I, T const>
|
class tuple_element<I, T const>
|
||||||
: public sprout::tuples::tuple_element<I, T>
|
: public sprout::tuples::tuple_element<I, T>
|
||||||
{};
|
{};
|
||||||
template<std::size_t I, typename T>
|
template<std::size_t I, typename T>
|
||||||
struct tuple_element<I, T volatile>
|
class tuple_element<I, T volatile>
|
||||||
: public sprout::tuples::tuple_element<I, T>
|
: public sprout::tuples::tuple_element<I, T>
|
||||||
{};
|
{};
|
||||||
template<std::size_t I, typename T>
|
template<std::size_t I, typename T>
|
||||||
struct tuple_element<I, T const volatile>
|
class tuple_element<I, T const volatile>
|
||||||
: public sprout::tuples::tuple_element<I, T>
|
: public sprout::tuples::tuple_element<I, T>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
|
|
@ -35,14 +35,14 @@ namespace sprout {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<int... Values>
|
template<int... Values>
|
||||||
struct tuple_size<boost::mpl::string<Values...> >
|
class tuple_size<boost::mpl::string<Values...> >
|
||||||
: public boost::mpl::size<boost::mpl::string<Values...> >
|
: public boost::mpl::size<boost::mpl::string<Values...> >
|
||||||
{};
|
{};
|
||||||
//
|
//
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, int... Values>
|
template<std::size_t I, int... Values>
|
||||||
struct tuple_element<I, boost::mpl::string<Values...> >
|
class tuple_element<I, boost::mpl::string<Values...> >
|
||||||
: public boost::mpl::at_c<boost::mpl::string<Values...>, I>
|
: public boost::mpl::at_c<boost::mpl::string<Values...>, I>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
|
|
@ -29,14 +29,14 @@ namespace sprout {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename... Types>
|
template<typename... Types>
|
||||||
struct tuple_size<boost::mpl::vector<Types...> >
|
class tuple_size<boost::mpl::vector<Types...> >
|
||||||
: public boost::mpl::size<boost::mpl::vector<Types...> >
|
: public boost::mpl::size<boost::mpl::vector<Types...> >
|
||||||
{};
|
{};
|
||||||
//
|
//
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename... Types>
|
template<std::size_t I, typename... Types>
|
||||||
struct tuple_element<I, boost::mpl::vector<Types...> >
|
class tuple_element<I, boost::mpl::vector<Types...> >
|
||||||
: public boost::mpl::at_c<boost::mpl::vector<Types...>, I>
|
: public boost::mpl::at_c<boost::mpl::vector<Types...>, I>
|
||||||
{};
|
{};
|
||||||
} // namespace types
|
} // namespace types
|
||||||
|
|
|
@ -29,14 +29,14 @@ namespace sprout {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename T, T... Values>
|
template<typename T, T... Values>
|
||||||
struct tuple_size<boost::mpl::vector_c<T, Values...> >
|
class tuple_size<boost::mpl::vector_c<T, Values...> >
|
||||||
: public boost::mpl::size<boost::mpl::vector_c<T, Values...> >
|
: public boost::mpl::size<boost::mpl::vector_c<T, Values...> >
|
||||||
{};
|
{};
|
||||||
//
|
//
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename T, T... Values>
|
template<std::size_t I, typename T, T... Values>
|
||||||
struct tuple_element<I, boost::mpl::vector_c<T, Values...> >
|
class tuple_element<I, boost::mpl::vector_c<T, Values...> >
|
||||||
: public boost::mpl::at_c<boost::mpl::vector_c<T, Values...>, I>
|
: public boost::mpl::at_c<boost::mpl::vector_c<T, Values...>, I>
|
||||||
{};
|
{};
|
||||||
} // namespace types
|
} // namespace types
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename T, T... Values>
|
template<typename T, T... Values>
|
||||||
struct tuple_size<sprout::types::integral_array<T, Values...> >
|
class tuple_size<sprout::types::integral_array<T, Values...> >
|
||||||
: public std::tuple_size<sprout::types::type_tuple<std::integral_constant<T, Values>...> >
|
: public std::tuple_size<sprout::types::type_tuple<std::integral_constant<T, Values>...> >
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename T, T... Values>
|
template<std::size_t I, typename T, T... Values>
|
||||||
struct tuple_element<I, sprout::types::integral_array<T, Values...> >
|
class tuple_element<I, sprout::types::integral_array<T, Values...> >
|
||||||
: public std::tuple_element<I, sprout::types::type_tuple<std::integral_constant<T, Values>...> >
|
: public std::tuple_element<I, sprout::types::type_tuple<std::integral_constant<T, Values>...> >
|
||||||
{};
|
{};
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename T, T... Values>
|
template<typename T, T... Values>
|
||||||
struct tuple_size<sprout::types::basic_string<T, Values...> >
|
class tuple_size<sprout::types::basic_string<T, Values...> >
|
||||||
: public std::tuple_size<sprout::types::integral_array<T, Values...> >
|
: public std::tuple_size<sprout::types::integral_array<T, Values...> >
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename T, T... Values>
|
template<std::size_t I, typename T, T... Values>
|
||||||
struct tuple_element<I, sprout::types::basic_string<T, Values...> >
|
class tuple_element<I, sprout::types::basic_string<T, Values...> >
|
||||||
: public std::tuple_element<I, sprout::types::integral_array<T, Values...> >
|
: public std::tuple_element<I, sprout::types::integral_array<T, Values...> >
|
||||||
{};
|
{};
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
|
@ -26,14 +26,14 @@ namespace sprout {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename T, typename Enable = void>
|
template<typename T, typename Enable = void>
|
||||||
struct tuple_size
|
class tuple_size
|
||||||
: public std::tuple_size<T>
|
: public std::tuple_size<T>
|
||||||
{};
|
{};
|
||||||
//
|
//
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename T, typename Enable = void>
|
template<std::size_t I, typename T, typename Enable = void>
|
||||||
struct tuple_element
|
class tuple_element
|
||||||
: public std::tuple_element<I, T>
|
: public std::tuple_element<I, T>
|
||||||
{};
|
{};
|
||||||
} // namespace types
|
} // namespace types
|
||||||
|
|
|
@ -23,14 +23,14 @@ namespace sprout {
|
||||||
|
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<std::size_t I, typename T>
|
template<std::size_t I, typename T>
|
||||||
struct tuple_element_impl;
|
class tuple_element_impl;
|
||||||
template<typename Head, typename... Tail>
|
template<typename Head, typename... Tail>
|
||||||
struct tuple_element_impl<0, sprout::types::type_tuple<Head, Tail...> > {
|
class tuple_element_impl<0, sprout::types::type_tuple<Head, Tail...> > {
|
||||||
public:
|
public:
|
||||||
typedef Head type;
|
typedef Head type;
|
||||||
};
|
};
|
||||||
template<std::size_t I, typename Head, typename... Tail>
|
template<std::size_t I, typename Head, typename... Tail>
|
||||||
struct tuple_element_impl<I, sprout::types::type_tuple<Head, Tail...> >
|
class tuple_element_impl<I, sprout::types::type_tuple<Head, Tail...> >
|
||||||
: public sprout::types::detail::tuple_element_impl<I - 1, sprout::types::type_tuple<Tail...> >
|
: public sprout::types::detail::tuple_element_impl<I - 1, sprout::types::type_tuple<Tail...> >
|
||||||
{};
|
{};
|
||||||
} // namespace detail
|
} // namespace detail
|
||||||
|
@ -44,7 +44,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename... Types>
|
template<typename... Types>
|
||||||
struct tuple_size<sprout::types::type_tuple<Types...> >
|
class tuple_size<sprout::types::type_tuple<Types...> >
|
||||||
: public std::integral_constant<std::size_t, sizeof...(Types)>
|
: public std::integral_constant<std::size_t, sizeof...(Types)>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename... Types>
|
template<std::size_t I, typename... Types>
|
||||||
struct tuple_element<I, sprout::types::type_tuple<Types...> >
|
class tuple_element<I, sprout::types::type_tuple<Types...> >
|
||||||
: public sprout::types::detail::tuple_element_impl<I, sprout::types::type_tuple<Types...> >
|
: public sprout::types::detail::tuple_element_impl<I, sprout::types::type_tuple<Types...> >
|
||||||
{};
|
{};
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
|
@ -169,14 +169,14 @@ namespace sprout {
|
||||||
namespace tuples {
|
namespace tuples {
|
||||||
namespace detail {
|
namespace detail {
|
||||||
template<std::size_t I, typename T>
|
template<std::size_t I, typename T>
|
||||||
struct tuple_element_impl;
|
class tuple_element_impl;
|
||||||
template<typename T1, typename T2>
|
template<typename T1, typename T2>
|
||||||
struct tuple_element_impl<0, sprout::pair<T1, T2> > {
|
class tuple_element_impl<0, sprout::pair<T1, T2> > {
|
||||||
public:
|
public:
|
||||||
typedef T1 type;
|
typedef T1 type;
|
||||||
};
|
};
|
||||||
template<typename T1, typename T2>
|
template<typename T1, typename T2>
|
||||||
struct tuple_element_impl<1, sprout::pair<T1, T2> > {
|
class tuple_element_impl<1, sprout::pair<T1, T2> > {
|
||||||
public:
|
public:
|
||||||
typedef T2 type;
|
typedef T2 type;
|
||||||
};
|
};
|
||||||
|
@ -189,7 +189,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename T1, typename T2>
|
template<typename T1, typename T2>
|
||||||
struct tuple_size<sprout::pair<T1, T2> >
|
class tuple_size<sprout::pair<T1, T2> >
|
||||||
: public std::integral_constant<std::size_t, 2>
|
: public std::integral_constant<std::size_t, 2>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename T1, typename T2>
|
template<std::size_t I, typename T1, typename T2>
|
||||||
struct tuple_element<I, sprout::pair<T1, T2> >
|
class tuple_element<I, sprout::pair<T1, T2> >
|
||||||
: public sprout::tuples::detail::tuple_element_impl<I, sprout::pair<T1, T2> >
|
: public sprout::tuples::detail::tuple_element_impl<I, sprout::pair<T1, T2> >
|
||||||
{};
|
{};
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
|
@ -264,7 +264,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<>
|
template<>
|
||||||
struct tuple_size<sprout::uuids::uuid> {
|
class tuple_size<sprout::uuids::uuid> {
|
||||||
public:
|
public:
|
||||||
typedef std::integral_constant<std::size_t, 16> type;
|
typedef std::integral_constant<std::size_t, 16> type;
|
||||||
SPROUT_STATIC_CONSTEXPR std::size_t value = type::value;
|
SPROUT_STATIC_CONSTEXPR std::size_t value = type::value;
|
||||||
|
@ -274,7 +274,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I>
|
template<std::size_t I>
|
||||||
struct tuple_element<I, sprout::uuids::uuid> {
|
class tuple_element<I, sprout::uuids::uuid> {
|
||||||
public:
|
public:
|
||||||
static_assert(I < 16, "tuple_element<>: index out of range");
|
static_assert(I < 16, "tuple_element<>: index out of range");
|
||||||
typedef sprout::uuids::uuid::value_type type;
|
typedef sprout::uuids::uuid::value_type type;
|
||||||
|
|
|
@ -266,7 +266,7 @@ namespace std {
|
||||||
// tuple_size
|
// tuple_size
|
||||||
//
|
//
|
||||||
template<typename... Types>
|
template<typename... Types>
|
||||||
struct tuple_size<sprout::variant<Types...> >
|
class tuple_size<sprout::variant<Types...> >
|
||||||
: public std::tuple_size<typename sprout::variant<Types...>::tuple_type>
|
: public std::tuple_size<typename sprout::variant<Types...>::tuple_type>
|
||||||
{};
|
{};
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ namespace std {
|
||||||
// tuple_element
|
// tuple_element
|
||||||
//
|
//
|
||||||
template<std::size_t I, typename... Types>
|
template<std::size_t I, typename... Types>
|
||||||
struct tuple_element<I, sprout::variant<Types...> >
|
class tuple_element<I, sprout::variant<Types...> >
|
||||||
: public std::tuple_element<I, typename sprout::variant<Types...>::tuple_type>
|
: public std::tuple_element<I, typename sprout::variant<Types...>::tuple_type>
|
||||||
{};
|
{};
|
||||||
} // namespace std
|
} // namespace std
|
||||||
|
|
|
@ -22,6 +22,11 @@ namespace sprout {
|
||||||
struct repeat_p
|
struct repeat_p
|
||||||
: public sprout::weed::parser_base
|
: public sprout::weed::parser_base
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
template<typename Context, typename Iterator>
|
||||||
|
struct attribute;
|
||||||
|
template<typename Context, typename Iterator>
|
||||||
|
struct result;
|
||||||
private:
|
private:
|
||||||
template<typename Context, typename Iterator>
|
template<typename Context, typename Iterator>
|
||||||
struct eval {
|
struct eval {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef SPROUT_WEED_PARSER_NUMERIC_BIN_HPP
|
#ifndef SPROUT_WEED_PARSER_NUMERIC_BIN_HPP
|
||||||
#define SPROUT_WEED_PARSER_NUMERIC_BIN_HPP
|
#define SPROUT_WEED_PARSER_NUMERIC_BIN_HPP
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/integer/integer_digits.hpp>
|
#include <sprout/integer/integer_digits.hpp>
|
||||||
|
@ -11,7 +12,7 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// bin
|
// bin
|
||||||
//
|
//
|
||||||
SPROUT_STATIC_CONSTEXPR auto bin = sprout::weed::uint_p<std::uintmax_t, 2, -1>();
|
SPROUT_STATIC_CONSTEXPR auto bin = sprout::weed::uint_p<std::uintmax_t, 2, static_cast<std::size_t>(-1)>();
|
||||||
|
|
||||||
//
|
//
|
||||||
// bin8
|
// bin8
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef SPROUT_WEED_PARSER_NUMERIC_HEX_HPP
|
#ifndef SPROUT_WEED_PARSER_NUMERIC_HEX_HPP
|
||||||
#define SPROUT_WEED_PARSER_NUMERIC_HEX_HPP
|
#define SPROUT_WEED_PARSER_NUMERIC_HEX_HPP
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/integer/integer_digits.hpp>
|
#include <sprout/integer/integer_digits.hpp>
|
||||||
|
@ -11,7 +12,7 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// hex
|
// hex
|
||||||
//
|
//
|
||||||
SPROUT_STATIC_CONSTEXPR auto hex = sprout::weed::uint_p<std::uintmax_t, 16, -1>();
|
SPROUT_STATIC_CONSTEXPR auto hex = sprout::weed::uint_p<std::uintmax_t, 16, static_cast<std::size_t>(-1)>();
|
||||||
|
|
||||||
//
|
//
|
||||||
// hex8
|
// hex8
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef SPROUT_WEED_PARSER_NUMERIC_INT_HPP
|
#ifndef SPROUT_WEED_PARSER_NUMERIC_INT_HPP
|
||||||
#define SPROUT_WEED_PARSER_NUMERIC_INT_HPP
|
#define SPROUT_WEED_PARSER_NUMERIC_INT_HPP
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/integer/integer_digits.hpp>
|
#include <sprout/integer/integer_digits.hpp>
|
||||||
|
@ -11,7 +12,7 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// int_
|
// int_
|
||||||
//
|
//
|
||||||
SPROUT_STATIC_CONSTEXPR auto int_ = sprout::weed::int_p<std::intmax_t, 10, 1, -1>();
|
SPROUT_STATIC_CONSTEXPR auto int_ = sprout::weed::int_p<std::intmax_t, 10, 1, static_cast<std::size_t>(-1)>();
|
||||||
|
|
||||||
//
|
//
|
||||||
// int8
|
// int8
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef SPROUT_WEED_PARSER_NUMERIC_OCT_HPP
|
#ifndef SPROUT_WEED_PARSER_NUMERIC_OCT_HPP
|
||||||
#define SPROUT_WEED_PARSER_NUMERIC_OCT_HPP
|
#define SPROUT_WEED_PARSER_NUMERIC_OCT_HPP
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/integer/integer_digits.hpp>
|
#include <sprout/integer/integer_digits.hpp>
|
||||||
|
@ -11,7 +12,7 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// oct
|
// oct
|
||||||
//
|
//
|
||||||
SPROUT_STATIC_CONSTEXPR auto oct = sprout::weed::uint_p<std::uintmax_t, 8, -1>();
|
SPROUT_STATIC_CONSTEXPR auto oct = sprout::weed::uint_p<std::uintmax_t, 8, static_cast<std::size_t>(-1)>();
|
||||||
|
|
||||||
//
|
//
|
||||||
// oct8
|
// oct8
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#ifndef SPROUT_WEED_PARSER_NUMERIC_UINT_HPP
|
#ifndef SPROUT_WEED_PARSER_NUMERIC_UINT_HPP
|
||||||
#define SPROUT_WEED_PARSER_NUMERIC_UINT_HPP
|
#define SPROUT_WEED_PARSER_NUMERIC_UINT_HPP
|
||||||
|
|
||||||
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/integer/integer_digits.hpp>
|
#include <sprout/integer/integer_digits.hpp>
|
||||||
|
@ -11,7 +12,7 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
// uint_
|
// uint_
|
||||||
//
|
//
|
||||||
SPROUT_STATIC_CONSTEXPR auto uint_ = sprout::weed::uint_p<std::uintmax_t, 10, 1, -1>();
|
SPROUT_STATIC_CONSTEXPR auto uint_ = sprout::weed::uint_p<std::uintmax_t, 10, 1, static_cast<std::size_t>(-1)>();
|
||||||
|
|
||||||
//
|
//
|
||||||
// uint8
|
// uint8
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace sprout {
|
||||||
//
|
//
|
||||||
template<typename T, typename Iterator, typename Context, typename = void>
|
template<typename T, typename Iterator, typename Context, typename = void>
|
||||||
struct limit_of
|
struct limit_of
|
||||||
: public std::integral_constant<std::size_t, -1>
|
: public std::integral_constant<std::size_t, static_cast<std::size_t>(-1)>
|
||||||
{};
|
{};
|
||||||
template<typename T, typename Iterator, typename Context>
|
template<typename T, typename Iterator, typename Context>
|
||||||
struct limit_of<T const, Iterator, Context>
|
struct limit_of<T const, Iterator, Context>
|
||||||
|
|
Loading…
Reference in a new issue