mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-18 15:24:11 +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
|
@ -13,22 +13,26 @@
|
|||
#include <sprout/utility/pair/pair.hpp>
|
||||
#include <sprout/utility/move.hpp>
|
||||
#include <sprout/type_traits/integral_constant.hpp>
|
||||
#include <sprout/type_traits/identity.hpp>
|
||||
#include <sprout/detail/nil_base.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace tuples {
|
||||
namespace detail {
|
||||
template<std::size_t I, typename T>
|
||||
struct tuple_element_impl;
|
||||
template<std::size_t I, typename T1, typename T2>
|
||||
struct tuple_element_impl<I, sprout::pair<T1, T2> >
|
||||
: public sprout::detail::nil_base
|
||||
{};
|
||||
template<typename T1, typename T2>
|
||||
struct tuple_element_impl<0, sprout::pair<T1, T2> > {
|
||||
public:
|
||||
typedef T1 type;
|
||||
};
|
||||
struct tuple_element_impl<0, sprout::pair<T1, T2> >
|
||||
: public sprout::identity<T1>
|
||||
{};
|
||||
template<typename T1, typename T2>
|
||||
struct tuple_element_impl<1, sprout::pair<T1, T2> > {
|
||||
public:
|
||||
typedef T2 type;
|
||||
};
|
||||
struct tuple_element_impl<1, sprout::pair<T1, T2> >
|
||||
: public sprout::identity<T2>
|
||||
{};
|
||||
|
||||
template<std::size_t I, typename T>
|
||||
struct get_impl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue