fix tuple_element: support SFINAE-friendly

This commit is contained in:
bolero-MURAKAMI 2014-05-29 00:25:37 +09:00
parent f42e92b448
commit c15de6136b
64 changed files with 984 additions and 113 deletions

View file

@ -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