mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-16 15:14:13 +00:00
fix tuple_element: support SFINAE-friendly
This commit is contained in:
parent
f42e92b448
commit
c15de6136b
64 changed files with 984 additions and 113 deletions
|
@ -15,6 +15,7 @@
|
|||
#include <sprout/type_traits/integral_constant.hpp>
|
||||
#include <sprout/type_traits/identity.hpp>
|
||||
#include <sprout/type_traits/enabler_if.hpp>
|
||||
#include <sprout/detail/nil_base.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
|
@ -30,7 +31,7 @@ namespace sprout {
|
|||
//
|
||||
template<std::size_t I, typename T, T... Args>
|
||||
struct pack_element_c
|
||||
: public sprout::pack_element<I, sprout::integral_constant<T, Args>...>::type
|
||||
: public sprout::pack_element<I, sprout::integral_constant<T, Args>...>
|
||||
{};
|
||||
|
||||
//
|
||||
|
@ -59,10 +60,16 @@ namespace sprout {
|
|||
//
|
||||
// head_element
|
||||
//
|
||||
template<typename... Args>
|
||||
struct head_element;
|
||||
template<typename Head, typename... Tail>
|
||||
struct head_element
|
||||
struct head_element<Head, Tail...>
|
||||
: public sprout::identity<Head>
|
||||
{};
|
||||
template<>
|
||||
struct head_element<>
|
||||
: public sprout::detail::nil_base
|
||||
{};
|
||||
|
||||
//
|
||||
// head_get
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue