fix std::array adapt

This commit is contained in:
bolero-MURAKAMI 2016-04-16 18:59:02 +09:00
parent 69c9233ca0
commit 14865d4d64
4 changed files with 70 additions and 20 deletions

View file

@ -13,6 +13,7 @@
#include <sprout/config.hpp>
#include <sprout/workaround/std/cstddef.hpp>
#include <sprout/utility/move.hpp>
#include <sprout/utility/as_const.hpp>
#include <sprout/tuple/tuple/tuple_access_traits.hpp>
#include <sprout/tuple/tuple/get.hpp>
@ -28,7 +29,7 @@ namespace sprout {
static SPROUT_CONSTEXPR T&
tuple_get(std::array<T, N>& t) SPROUT_NOEXCEPT {
static_assert(I < N, "tuple_get: index out of range");
return t[I];
return const_cast<T&>(sprout::as_const(t)[I]);
}
template<std::size_t I>
static SPROUT_CONSTEXPR T const&