mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
[desuructive changes] container traits new interface [破壊的変更]
This commit is contained in:
parent
52a2178ac1
commit
ad60c8c530
356 changed files with 3183 additions and 3251 deletions
|
@ -5,8 +5,8 @@
|
|||
#include <iterator>
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/fixed_container/traits.hpp>
|
||||
#include <sprout/fixed_container/functions.hpp>
|
||||
#include <sprout/container/traits.hpp>
|
||||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -18,13 +18,13 @@ namespace sprout {
|
|||
template<typename ContainerContainer>
|
||||
struct join {
|
||||
public:
|
||||
typedef typename sprout::rebind_fixed_size<
|
||||
typename sprout::fixed_container_traits<ContainerContainer>::value_type
|
||||
>::template apply<
|
||||
sprout::fixed_container_traits<
|
||||
typename sprout::fixed_container_traits<ContainerContainer>::value_type
|
||||
>::fixed_size
|
||||
* sprout::fixed_container_traits<ContainerContainer>::fixed_size
|
||||
typedef typename sprout::container_transform_traits<
|
||||
typename sprout::container_traits<ContainerContainer>::value_type
|
||||
>::template rebind_size<
|
||||
sprout::container_traits<
|
||||
typename sprout::container_traits<ContainerContainer>::value_type
|
||||
>::static_size
|
||||
* sprout::container_traits<ContainerContainer>::static_size
|
||||
>::type type;
|
||||
};
|
||||
} // namespace result_of
|
||||
|
@ -32,7 +32,7 @@ namespace sprout {
|
|||
namespace detail {
|
||||
template<typename Result, typename ContainerInputIterator, typename... Args>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
sprout::fixed_container_traits<Result>::fixed_size == sizeof...(Args),
|
||||
sprout::container_traits<Result>::static_size == sizeof...(Args),
|
||||
Result
|
||||
>::type join_impl(
|
||||
ContainerInputIterator first_cont,
|
||||
|
@ -41,7 +41,7 @@ namespace sprout {
|
|||
);
|
||||
template<typename Result, typename ContainerInputIterator, typename... Args>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
sprout::fixed_container_traits<Result>::fixed_size != sizeof...(Args),
|
||||
sprout::container_traits<Result>::static_size != sizeof...(Args),
|
||||
Result
|
||||
>::type join_impl(
|
||||
ContainerInputIterator first_cont,
|
||||
|
@ -50,7 +50,7 @@ namespace sprout {
|
|||
);
|
||||
template<typename Result, typename ContainerInputIterator, typename InputIterator, typename... Args>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
sprout::fixed_container_traits<Result>::fixed_size == sizeof...(Args),
|
||||
sprout::container_traits<Result>::static_size == sizeof...(Args),
|
||||
Result
|
||||
>::type join_impl_1(
|
||||
ContainerInputIterator first_cont,
|
||||
|
@ -60,11 +60,11 @@ namespace sprout {
|
|||
Args const&... args
|
||||
)
|
||||
{
|
||||
return sprout::make_clone<Result>(args...);
|
||||
return sprout::make<Result>(args...);
|
||||
}
|
||||
template<typename Result, typename ContainerInputIterator, typename InputIterator, typename... Args>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
sprout::fixed_container_traits<Result>::fixed_size != sizeof...(Args),
|
||||
sprout::container_traits<Result>::static_size != sizeof...(Args),
|
||||
Result
|
||||
>::type join_impl_1(
|
||||
ContainerInputIterator first_cont,
|
||||
|
@ -81,7 +81,7 @@ namespace sprout {
|
|||
}
|
||||
template<typename Result, typename ContainerInputIterator, typename... Args>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
sprout::fixed_container_traits<Result>::fixed_size == sizeof...(Args),
|
||||
sprout::container_traits<Result>::static_size == sizeof...(Args),
|
||||
Result
|
||||
>::type join_impl(
|
||||
ContainerInputIterator first_cont,
|
||||
|
@ -89,11 +89,11 @@ namespace sprout {
|
|||
Args const&... args
|
||||
)
|
||||
{
|
||||
return sprout::make_clone<Result>(args...);
|
||||
return sprout::make<Result>(args...);
|
||||
}
|
||||
template<typename Result, typename ContainerInputIterator, typename... Args>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
sprout::fixed_container_traits<Result>::fixed_size != sizeof...(Args),
|
||||
sprout::container_traits<Result>::static_size != sizeof...(Args),
|
||||
Result
|
||||
>::type join_impl(
|
||||
ContainerInputIterator first_cont,
|
||||
|
@ -103,7 +103,7 @@ namespace sprout {
|
|||
{
|
||||
return first_cont != last_cont
|
||||
? sprout::algorithm::detail::join_impl_1<Result>(first_cont, last_cont, sprout::begin(*first_cont), sprout::end(*first_cont), args...)
|
||||
: sprout::make_clone<Result>(args...)
|
||||
: sprout::make<Result>(args...)
|
||||
;
|
||||
}
|
||||
} // namespace detail
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include <type_traits>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/fixed_container/traits.hpp>
|
||||
#include <sprout/fixed_container/functions.hpp>
|
||||
#include <sprout/container/traits.hpp>
|
||||
#include <sprout/container/functions.hpp>
|
||||
#include <sprout/iterator/operation.hpp>
|
||||
#include <sprout/operation/fixed/append_back.hpp>
|
||||
|
||||
|
@ -17,19 +17,19 @@ namespace sprout {
|
|||
template<typename ContainerContainer, typename Separator>
|
||||
struct join2 {
|
||||
public:
|
||||
typedef typename sprout::rebind_fixed_size<
|
||||
typename sprout::fixed_container_traits<ContainerContainer>::value_type
|
||||
>::template apply<
|
||||
sprout::fixed_container_traits<ContainerContainer>::fixed_size != 0
|
||||
typedef typename sprout::container_transform_traits<
|
||||
typename sprout::container_traits<ContainerContainer>::value_type
|
||||
>::template rebind_size<
|
||||
sprout::container_traits<ContainerContainer>::static_size != 0
|
||||
? (
|
||||
sprout::fixed_container_traits<
|
||||
typename sprout::fixed_container_traits<ContainerContainer>::value_type
|
||||
>::fixed_size
|
||||
+ (sprout::fixed_container_traits<ContainerContainer>::fixed_size - 1) * (
|
||||
sprout::fixed_container_traits<Separator>::fixed_size
|
||||
+ sprout::fixed_container_traits<
|
||||
typename sprout::fixed_container_traits<ContainerContainer>::value_type
|
||||
>::fixed_size
|
||||
sprout::container_traits<
|
||||
typename sprout::container_traits<ContainerContainer>::value_type
|
||||
>::static_size
|
||||
+ (sprout::container_traits<ContainerContainer>::static_size - 1) * (
|
||||
sprout::container_traits<Separator>::static_size
|
||||
+ sprout::container_traits<
|
||||
typename sprout::container_traits<ContainerContainer>::value_type
|
||||
>::static_size
|
||||
)
|
||||
)
|
||||
: 0
|
||||
|
@ -40,7 +40,7 @@ namespace sprout {
|
|||
namespace detail {
|
||||
template<typename Result, typename ContainerIterator, typename Separator, typename Container>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
(sprout::fixed_container_traits<Container>::fixed_size == sprout::fixed_container_traits<Result>::fixed_size),
|
||||
(sprout::container_traits<Container>::static_size == sprout::container_traits<Result>::static_size),
|
||||
Result
|
||||
>::type join2_impl_1(
|
||||
ContainerIterator first,
|
||||
|
@ -53,7 +53,7 @@ namespace sprout {
|
|||
}
|
||||
template<typename Result, typename ContainerIterator, typename Separator, typename Container>
|
||||
SPROUT_CONSTEXPR inline typename std::enable_if<
|
||||
(sprout::fixed_container_traits<Container>::fixed_size < sprout::fixed_container_traits<Result>::fixed_size),
|
||||
(sprout::container_traits<Container>::static_size < sprout::container_traits<Result>::static_size),
|
||||
Result
|
||||
>::type join2_impl_1(
|
||||
ContainerIterator first,
|
||||
|
@ -83,7 +83,7 @@ namespace sprout {
|
|||
separator,
|
||||
*first
|
||||
)
|
||||
: sprout::make_clone<Result>()
|
||||
: sprout::make<Result>()
|
||||
;
|
||||
}
|
||||
} // namespace detail
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue