mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
std::get のオーバーロード削除
This commit is contained in:
parent
871f9179c4
commit
40036a4c05
10 changed files with 94 additions and 109 deletions
|
@ -324,24 +324,6 @@ namespace std {
|
||||||
static_assert(I < N, "tuple_element<>: index out of range");
|
static_assert(I < N, "tuple_element<>: index out of range");
|
||||||
typedef T type;
|
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
|
} // namespace std
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_ARRAY_HPP
|
#endif // #ifndef SPROUT_ARRAY_HPP
|
||||||
|
|
|
@ -279,33 +279,6 @@ namespace std {
|
||||||
static_assert(I < sprout::fixed_container_traits<sprout::pit<Container> >::fixed_size, "tuple_element<>: index out of range");
|
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;
|
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
|
} // namespace std
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_PIT_HPP
|
#endif // #ifndef SPROUT_PIT_HPP
|
||||||
|
|
|
@ -1062,24 +1062,6 @@ namespace std {
|
||||||
static_assert(I < N, "tuple_element<>: index out of range");
|
static_assert(I < N, "tuple_element<>: index out of range");
|
||||||
typedef T type;
|
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
|
} // namespace std
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_STRING_HPP
|
#endif // #ifndef SPROUT_STRING_HPP
|
||||||
|
|
|
@ -942,33 +942,6 @@ namespace std {
|
||||||
>::type
|
>::type
|
||||||
>::type 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
|
} // namespace std
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_SUB_ARRAY_HPP
|
#endif // #ifndef SPROUT_SUB_ARRAY_HPP
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define SPROUT_TUPLE_ARRAY_HPP
|
#define SPROUT_TUPLE_ARRAY_HPP
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <utility>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/tuple/tuple.hpp>
|
#include <sprout/tuple/tuple.hpp>
|
||||||
|
|
44
sprout/tuple/pit.hpp
Normal file
44
sprout/tuple/pit.hpp
Normal 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
|
|
@ -2,6 +2,7 @@
|
||||||
#define SPROUT_TUPLE_STRING_HPP
|
#define SPROUT_TUPLE_STRING_HPP
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <utility>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/tuple/tuple.hpp>
|
#include <sprout/tuple/tuple.hpp>
|
||||||
|
|
46
sprout/tuple/sub_array.hpp
Normal file
46
sprout/tuple/sub_array.hpp
Normal 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
|
|
@ -2,6 +2,7 @@
|
||||||
#define SPROUT_TUPLE_UUID_HPP
|
#define SPROUT_TUPLE_UUID_HPP
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <utility>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <sprout/config.hpp>
|
#include <sprout/config.hpp>
|
||||||
#include <sprout/tuple/tuple.hpp>
|
#include <sprout/tuple/tuple.hpp>
|
||||||
|
@ -24,7 +25,7 @@ namespace sprout {
|
||||||
}
|
}
|
||||||
template<std::size_t I>
|
template<std::size_t I>
|
||||||
sprout::uuids::uuid::value_type&& get(sprout::uuids::uuid&& t) SPROUT_NOEXCEPT {
|
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
|
} // namespace tuples
|
||||||
|
|
||||||
|
|
|
@ -280,24 +280,6 @@ namespace std {
|
||||||
static_assert(I < 16, "tuple_element<>: index out of range");
|
static_assert(I < 16, "tuple_element<>: index out of range");
|
||||||
typedef sprout::uuids::uuid::value_type type;
|
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
|
} // namespace std
|
||||||
|
|
||||||
#endif // #ifndef SPROUT_UUID_UUID_HPP
|
#endif // #ifndef SPROUT_UUID_UUID_HPP
|
||||||
|
|
Loading…
Reference in a new issue