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

std::get のオーバーロード削除

This commit is contained in:
bolero-MURAKAMI 2011-10-31 20:30:08 +09:00
parent 871f9179c4
commit 40036a4c05
10 changed files with 94 additions and 109 deletions

View file

@ -324,24 +324,6 @@ namespace std {
static_assert(I < N, "tuple_element<>: index out of range");
typedef T type;
};
//
// get
//
template<std::size_t I, typename T, std::size_t N>
T& get(sprout::array<T, N>& t) SPROUT_NOEXCEPT {
static_assert(I < N, "get: index out of range");
return t[I];
}
template<std::size_t I, typename T, std::size_t N>
SPROUT_CONSTEXPR T const& get(sprout::array<T, N> const& t) SPROUT_NOEXCEPT {
static_assert(I < N, "get: index out of range");
return t[I];
}
template<std::size_t I, typename T, std::size_t N>
T&& get(sprout::array<T, N>&& t) SPROUT_NOEXCEPT {
return std::move(std::get<I>(t));
}
} // namespace std
#endif // #ifndef SPROUT_ARRAY_HPP

View file

@ -279,33 +279,6 @@ namespace std {
static_assert(I < sprout::fixed_container_traits<sprout::pit<Container> >::fixed_size, "tuple_element<>: index out of range");
typedef typename sprout::fixed_container_traits<sprout::pit<Container> >::value_type type;
};
//
// get
//
template<std::size_t I, typename Container>
typename sprout::fixed_container_traits<sprout::pit<Container> >::value_type& get(
sprout::pit<Container>& t
) SPROUT_NOEXCEPT
{
static_assert(I < sprout::fixed_container_traits<sprout::pit<Container> >::fixed_size, "get: index out of range");
return t[I];
}
template<std::size_t I, typename Container>
SPROUT_CONSTEXPR typename sprout::fixed_container_traits<sprout::pit<Container> >::value_type const& get(
sprout::pit<Container> const& t
) SPROUT_NOEXCEPT
{
static_assert(I < sprout::fixed_container_traits<sprout::pit<Container> >::fixed_size, "get: index out of range");
return t[I];
}
template<std::size_t I, typename Container>
typename sprout::fixed_container_traits<sprout::pit<Container> >::value_type&& get(
sprout::pit<Container>&& t
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::move(std::get<I>(t))))
{
return std::move(std::get<I>(t));
}
} // namespace std
#endif // #ifndef SPROUT_PIT_HPP

View file

@ -1062,24 +1062,6 @@ namespace std {
static_assert(I < N, "tuple_element<>: index out of range");
typedef T type;
};
//
// get
//
template<std::size_t I, typename T, std::size_t N, typename Traits>
T& get(sprout::basic_string<T, N, Traits>& t) SPROUT_NOEXCEPT {
static_assert(I < N, "get: index out of range");
return t[I];
}
template<std::size_t I, typename T, std::size_t N, typename Traits>
SPROUT_CONSTEXPR T const& get(sprout::basic_string<T, N, Traits> const& t) SPROUT_NOEXCEPT {
static_assert(I < N, "get: index out of range");
return t[I];
}
template<std::size_t I, typename T, std::size_t N, typename Traits>
T&& get(sprout::basic_string<T, N, Traits>&& t) SPROUT_NOEXCEPT {
return std::move(std::get<I>(t));
}
} // namespace std
#endif // #ifndef SPROUT_STRING_HPP

View file

@ -942,33 +942,6 @@ namespace std {
>::type
>::type type;
};
//
// get
//
template<std::size_t I, typename Container>
typename sprout::fixed_container_traits<sprout::sub_array<Container> >::value_type& get(
sprout::sub_array<Container>& t
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*sprout::next(sprout::fixed_begin(t), I)))
{
static_assert(I < sprout::fixed_container_traits<sprout::sub_array<Container> >::fixed_size, "get: index out of range");
return *sprout::next(sprout::fixed_begin(t), I);
}
template<std::size_t I, typename Container>
SPROUT_CONSTEXPR typename sprout::fixed_container_traits<sprout::sub_array<Container> >::value_type const& get(
sprout::sub_array<Container> const& t
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*sprout::next(sprout::fixed_begin(t), I)))
{
static_assert(I < sprout::fixed_container_traits<sprout::sub_array<Container> >::fixed_size, "get: index out of range");
return *sprout::next(sprout::fixed_begin(t), I);
}
template<std::size_t I, typename Container>
typename sprout::fixed_container_traits<sprout::sub_array<Container> >::value_type&& get(
sprout::sub_array<Container>&& t
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::move(std::get<I>(t))))
{
return std::move(std::get<I>(t));
}
} // namespace std
#endif // #ifndef SPROUT_SUB_ARRAY_HPP

View file

@ -2,6 +2,7 @@
#define SPROUT_TUPLE_ARRAY_HPP
#include <cstddef>
#include <utility>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/tuple.hpp>

44
sprout/tuple/pit.hpp Normal file
View file

@ -0,0 +1,44 @@
#ifndef SPROUT_TUPLE_PIT_HPP
#define SPROUT_TUPLE_PIT_HPP
#include <cstddef>
#include <utility>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/pit.hpp>
namespace sprout {
namespace tuples {
//
// get
//
template<std::size_t I, typename Container>
typename sprout::fixed_container_traits<sprout::pit<Container> >::value_type& get(
sprout::pit<Container>& t
) SPROUT_NOEXCEPT
{
static_assert(I < sprout::fixed_container_traits<sprout::pit<Container> >::fixed_size, "get: index out of range");
return t[I];
}
template<std::size_t I, typename Container>
SPROUT_CONSTEXPR typename sprout::fixed_container_traits<sprout::pit<Container> >::value_type const& get(
sprout::pit<Container> const& t
) SPROUT_NOEXCEPT
{
static_assert(I < sprout::fixed_container_traits<sprout::pit<Container> >::fixed_size, "get: index out of range");
return t[I];
}
template<std::size_t I, typename Container>
typename sprout::fixed_container_traits<sprout::pit<Container> >::value_type&& get(
sprout::pit<Container>&& t
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::move(sprout::tuples::get<I>(t))))
{
return std::move(sprout::tuples::get<I>(t));
}
} // namespace tuples
using sprout::tuples::get;
} // namespace sprout
#endif // #ifndef SPROUT_TUPLE_PIT_HPP

View file

@ -2,6 +2,7 @@
#define SPROUT_TUPLE_STRING_HPP
#include <cstddef>
#include <utility>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/tuple.hpp>

View file

@ -0,0 +1,46 @@
#ifndef SPROUT_TUPLE_SUB_ARRAY_HPP
#define SPROUT_TUPLE_SUB_ARRAY_HPP
#include <cstddef>
#include <utility>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/fixed_container/functions.hpp>
#include <sprout/iterator/operation.hpp>
#include <sprout/tuple/tuple.hpp>
#include <sprout/sub_array.hpp>
namespace sprout {
namespace tuples {
//
// get
//
template<std::size_t I, typename Container>
typename sprout::fixed_container_traits<sprout::sub_array<Container> >::value_type& get(
sprout::sub_array<Container>& t
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*sprout::next(sprout::fixed_begin(t), I)))
{
static_assert(I < sprout::fixed_container_traits<sprout::sub_array<Container> >::fixed_size, "get: index out of range");
return *sprout::next(sprout::fixed_begin(t), I);
}
template<std::size_t I, typename Container>
SPROUT_CONSTEXPR typename sprout::fixed_container_traits<sprout::sub_array<Container> >::value_type const& get(
sprout::sub_array<Container> const& t
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(*sprout::next(sprout::fixed_begin(t), I)))
{
static_assert(I < sprout::fixed_container_traits<sprout::sub_array<Container> >::fixed_size, "get: index out of range");
return *sprout::next(sprout::fixed_begin(t), I);
}
template<std::size_t I, typename Container>
typename sprout::fixed_container_traits<sprout::sub_array<Container> >::value_type&& get(
sprout::sub_array<Container>&& t
) SPROUT_NOEXCEPT_EXPR(SPROUT_NOEXCEPT_EXPR(std::move(sprout::tuples::get<I>(t))))
{
return std::move(sprout::tuples::get<I>(t));
}
} // namespace tuples
using sprout::tuples::get;
} // namespace sprout
#endif // #ifndef SPROUT_TUPLE_SUB_ARRAY_HPP

View file

@ -2,6 +2,7 @@
#define SPROUT_TUPLE_UUID_HPP
#include <cstddef>
#include <utility>
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/tuple/tuple.hpp>
@ -24,7 +25,7 @@ namespace sprout {
}
template<std::size_t I>
sprout::uuids::uuid::value_type&& get(sprout::uuids::uuid&& t) SPROUT_NOEXCEPT {
return std::move(std::get<I>(t));
return std::move(sprout::tuples::get<I>(t));
}
} // namespace tuples

View file

@ -280,24 +280,6 @@ namespace std {
static_assert(I < 16, "tuple_element<>: index out of range");
typedef sprout::uuids::uuid::value_type type;
};
//
// get
//
template<std::size_t I>
sprout::uuids::uuid::value_type& get(sprout::uuids::uuid& t) SPROUT_NOEXCEPT {
static_assert(I < 16, "get: index out of range");
return t[I];
}
template<std::size_t I>
SPROUT_CONSTEXPR sprout::uuids::uuid::value_type const& get(sprout::uuids::uuid const& t) SPROUT_NOEXCEPT {
static_assert(I < 16, "get: index out of range");
return t[I];
}
template<std::size_t I>
sprout::uuids::uuid::value_type&& get(sprout::uuids::uuid&& t) SPROUT_NOEXCEPT {
return std::move(std::get<I>(t));
}
} // namespace std
#endif // #ifndef SPROUT_UUID_UUID_HPP