1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00

fix tuples::get

This commit is contained in:
bolero-MURAKAMI 2014-07-12 23:42:42 +09:00
parent 66cea44736
commit be5fc7df52

View file

@ -68,7 +68,7 @@ namespace sprout_tuple_detail {
template<std::size_t I, typename T> template<std::size_t I, typename T>
inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_element<I, T>::type& inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_element<I, T>::type&
tuple_get(T& t) tuple_get(T& t)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::tuple_access_traits<T>::template tuple_get<I>(std::declval<T>()))) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::tuple_access_traits<T>::template tuple_get<I>(std::declval<T&>())))
{ {
return sprout::tuples::tuple_access_traits<T>::template tuple_get<I>(t); return sprout::tuples::tuple_access_traits<T>::template tuple_get<I>(t);
} }
@ -78,14 +78,14 @@ namespace sprout_tuple_detail {
typename sprout::tuples::tuple_element<I, typename std::remove_reference<T>::type>::type&& typename sprout::tuples::tuple_element<I, typename std::remove_reference<T>::type>::type&&
>::type >::type
tuple_get(T&& t) tuple_get(T&& t)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::tuple_access_traits<typename std::remove_reference<T>::type>::template tuple_get<I>(std::declval<T>()))) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::tuple_access_traits<T>::template tuple_get<I>(std::declval<T&&>())))
{ {
return sprout::tuples::tuple_access_traits<T>::template tuple_get<I>(t); return sprout::tuples::tuple_access_traits<T>::template tuple_get<I>(t);
} }
template<std::size_t I, typename T> template<std::size_t I, typename T>
inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_element<I, T>::type const& inline SPROUT_CONSTEXPR typename sprout::tuples::tuple_element<I, T>::type const&
tuple_get(T const& t) tuple_get(T const& t)
SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::tuple_access_traits<T const>::template tuple_get<I>(std::declval<T>()))) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(sprout::tuples::tuple_access_traits<T const>::template tuple_get<I>(std::declval<T const&>())))
{ {
return sprout::tuples::tuple_access_traits<T const>::template tuple_get<I>(t); return sprout::tuples::tuple_access_traits<T const>::template tuple_get<I>(t);
} }