/*============================================================================= Copyright (c) 2011-2013 Bolero MURAKAMI 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_PIT_CONTAINER_HPP #define SPROUT_PIT_CONTAINER_HPP #include #include #include #include #include namespace sprout { namespace detail { template struct pit_container_construct_traits; template struct pit_container_construct_traits< sprout::pit, typename std::enable_if::value>::type > { public: typedef typename sprout::container_construct_traits::copied_type copied_type; public: template static SPROUT_CONSTEXPR copied_type deep_copy(Cont&&) { return copied_type(); } template static SPROUT_CONSTEXPR copied_type make(Args&&... args) { return sprout::make(sprout::forward(args)...); } template static SPROUT_CONSTEXPR copied_type remake(Cont&& cont, typename sprout::container_traits >::difference_type size, Args&&... args) { return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); } }; template struct pit_container_construct_traits< sprout::pit, typename std::enable_if::value>::type > { public: typedef typename sprout::container_construct_traits::copied_type copied_type; public: template static SPROUT_CONSTEXPR copied_type deep_copy(Cont&&) { return copied_type(); } template static SPROUT_CONSTEXPR copied_type make(Args&&... args) { return sprout::make(sprout::forward(args)...); } template static SPROUT_CONSTEXPR copied_type remake(Cont&& cont, typename sprout::container_traits >::difference_type size, Args&&... args) { return sprout::remake(sprout::forward(cont), size, sprout::forward(args)...); } template static SPROUT_CONSTEXPR copied_type remake(Cont&&, typename sprout::container_traits >::difference_type, InputIterator first, InputIterator last) { return copied_type(first, last); } }; } // namespace detail // // container_construct_traits // template struct container_construct_traits > : public sprout::detail::pit_container_construct_traits > {}; // // container_transform_traits // template struct container_transform_traits > { public: template >::size_type Size> struct rebind_size { public: typedef sprout::pit< typename sprout::container_transform_traits::template rebind_size::type > type; }; }; } // namespace sprout #endif // #ifndef SPROUT_PIT_CONTAINER_HPP