1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

change sprout::array adapt

This commit is contained in:
bolero-MURAKAMI 2016-04-16 20:12:55 +09:00
parent 14865d4d64
commit 92cc7881d6
5 changed files with 117 additions and 17 deletions

View file

@ -32,10 +32,9 @@ namespace sprout {
template<typename T, typename U>
SPROUT_CONSTEXPR decltype(std::declval<T>()[std::declval<U>()])
operator()(T&& x, U&& y)
const SPROUT_NOEXCEPT_IF_EXPR(std::declval<T>()[std::declval<U>()])
const SPROUT_NOEXCEPT_IF_EXPR(const_cast<decltype(std::declval<T>()[std::declval<U>()])>(sprout::as_const(std::declval<T>())[std::declval<U>()]))
{
typedef decltype(std::declval<T>()[std::declval<U>()]) type;
return const_cast<type>(sprout::as_const(x)[SPROUT_FORWARD(U, y)]);
return const_cast<decltype(std::declval<T>()[std::declval<U>()])>(sprout::as_const(x)[SPROUT_FORWARD(U, y)]);
}
};
} // namespace detail