mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +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,8 @@
|
|||
#include <sprout/utility/move.hpp>
|
||||
#include <sprout/tuple/tuple/get.hpp>
|
||||
#include <sprout/type_traits/integral_constant.hpp>
|
||||
#include <sprout/type_traits/identity.hpp>
|
||||
#include <sprout/detail/nil_base.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
|
@ -56,11 +58,9 @@ namespace std {
|
|||
// tuple_element
|
||||
//
|
||||
template<std::size_t I, typename T, std::size_t N, typename Traits>
|
||||
struct tuple_element<I, sprout::basic_string<T, N, Traits> > {
|
||||
static_assert(I < N, "tuple_element<>: index out of range");
|
||||
public:
|
||||
typedef T type;
|
||||
};
|
||||
struct tuple_element<I, sprout::basic_string<T, N, Traits> >
|
||||
: public std::conditional<(I < N), sprout::identity<T>, sprout::detail::nil_base>::type
|
||||
{};
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue