2014-07-10 08:08:33 +00:00
|
|
|
/*=============================================================================
|
2019-01-07 08:47:17 +00:00
|
|
|
Copyright (c) 2011-2019 Bolero MURAKAMI
|
2014-07-10 08:08:33 +00:00
|
|
|
https://github.com/bolero-MURAKAMI/Sprout
|
|
|
|
|
|
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
=============================================================================*/
|
|
|
|
#ifndef SPROUT_COMPLEX_CONTAINER_HPP
|
|
|
|
#define SPROUT_COMPLEX_CONTAINER_HPP
|
|
|
|
|
2016-02-26 16:21:46 +00:00
|
|
|
#include <sprout/config.hpp>
|
2014-07-10 08:08:33 +00:00
|
|
|
#include <sprout/utility/forward.hpp>
|
|
|
|
#include <sprout/complex/complex.hpp>
|
|
|
|
#include <sprout/container/traits.hpp>
|
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
//
|
|
|
|
// container_construct_traits
|
|
|
|
//
|
|
|
|
template<typename T>
|
|
|
|
struct container_construct_traits<sprout::complex<T> > {
|
|
|
|
public:
|
|
|
|
typedef sprout::complex<T> copied_type;
|
|
|
|
public:
|
|
|
|
template<typename Cont>
|
|
|
|
static SPROUT_CONSTEXPR copied_type
|
|
|
|
deep_copy(Cont&& cont) {
|
|
|
|
return SPROUT_FORWARD(Cont, cont);
|
|
|
|
}
|
|
|
|
template<typename... Args>
|
|
|
|
static SPROUT_CONSTEXPR copied_type
|
|
|
|
make(Args&&... args) {
|
|
|
|
return copied_type(SPROUT_FORWARD(Args, args)...);
|
|
|
|
}
|
|
|
|
template<typename Cont, typename... Args>
|
|
|
|
static SPROUT_CONSTEXPR copied_type
|
2014-07-12 04:26:04 +00:00
|
|
|
remake(Cont&&, typename sprout::container_traits<sprout::complex<T> >::difference_type, Args&&... args) {
|
2014-07-10 08:08:33 +00:00
|
|
|
return copied_type(SPROUT_FORWARD(Args, args)...);
|
|
|
|
}
|
|
|
|
};
|
2016-04-03 07:08:09 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// container_transform_traits
|
|
|
|
//
|
|
|
|
template<typename T>
|
|
|
|
struct container_transform_traits<sprout::complex<T> > {
|
|
|
|
public:
|
|
|
|
template<typename Type>
|
|
|
|
struct rebind_type {
|
|
|
|
public:
|
|
|
|
typedef sprout::complex<Type> type;
|
|
|
|
};
|
|
|
|
};
|
2014-07-10 08:08:33 +00:00
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_COMPLEX_CONTAINER_HPP
|