2012-06-22 10:14:21 +00:00
|
|
|
#ifndef SPROUT_PIT_CONTAINER_HPP
|
|
|
|
#define SPROUT_PIT_CONTAINER_HPP
|
|
|
|
|
|
|
|
#include <type_traits>
|
|
|
|
#include <sprout/utility/forward.hpp>
|
|
|
|
#include <sprout/pit/pit.hpp>
|
|
|
|
#include <sprout/container/traits.hpp>
|
|
|
|
#include <sprout/container/functions.hpp>
|
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
//
|
|
|
|
// container_construct_traits
|
|
|
|
//
|
|
|
|
template<typename Container>
|
|
|
|
struct container_construct_traits<sprout::pit<Container> > {
|
|
|
|
public:
|
|
|
|
typedef typename sprout::container_construct_traits<Container>::copied_type copied_type;
|
|
|
|
public:
|
|
|
|
template<typename Cont>
|
2012-10-05 15:58:56 +00:00
|
|
|
static SPROUT_CONSTEXPR copied_type
|
|
|
|
deep_copy(Cont&& cont) {
|
2012-06-22 10:14:21 +00:00
|
|
|
return copied_type();
|
|
|
|
}
|
|
|
|
template<typename... Args>
|
2012-10-05 15:58:56 +00:00
|
|
|
static SPROUT_CONSTEXPR copied_type
|
|
|
|
make(Args&&... args) {
|
2012-06-22 10:14:21 +00:00
|
|
|
return sprout::make<copied_type>(sprout::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
template<typename Cont, typename... Args>
|
2012-10-05 15:58:56 +00:00
|
|
|
static SPROUT_CONSTEXPR copied_type
|
|
|
|
remake(Cont&& cont, typename sprout::container_traits<sprout::pit<Container> >::difference_type size, Args&&... args) {
|
2012-06-22 10:14:21 +00:00
|
|
|
return sprout::remake<copied_type>(sprout::forward<Cont>(cont), size, sprout::forward<Args>(args)...);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
// container_transform_traits
|
|
|
|
//
|
|
|
|
template<typename Container>
|
|
|
|
struct container_transform_traits<sprout::pit<Container> > {
|
|
|
|
public:
|
|
|
|
template<typename sprout::container_traits<sprout::pit<Container> >::size_type Size>
|
|
|
|
struct rebind_size {
|
|
|
|
public:
|
|
|
|
typedef sprout::pit<
|
|
|
|
typename sprout::container_transform_traits<Container>::template rebind_size<Size>::type
|
|
|
|
> type;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_PIT_CONTAINER_HPP
|