/*============================================================================= Copyright (c) 2011-2017 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_CONTAINER_CONTAINER_TRANSFORM_TRAITS_HPP #define SPROUT_CONTAINER_CONTAINER_TRANSFORM_TRAITS_HPP #include #include #include #include #include #include namespace sprout { // // container_transform_traits // namespace detail { template::size_type Size> struct default_array_rebind_size; template< template class Array, typename T, std::size_t N, typename sprout::container_traits >::size_type Size > struct default_array_rebind_size, Size> { public: typedef Array type; }; template struct default_array_rebind_type; template< template class Array, typename T, std::size_t N, typename Type > struct default_array_rebind_type, Type> { public: typedef Array type; }; template struct inherit_default_rebind_size {}; template struct inherit_default_rebind_size< Container, typename std::enable_if::value>::type > { public: template::size_type Size> struct rebind_size : public sprout::detail::default_array_rebind_size {}; }; template struct inherit_default_rebind_type {}; template struct inherit_default_rebind_type< Container, typename std::enable_if::value>::type > { public: template struct rebind_type : public sprout::detail::default_array_rebind_type {}; }; } // namespace detail template struct container_transform_traits : public sprout::detail::inherit_default_rebind_size , public sprout::detail::inherit_default_rebind_type {}; template struct container_transform_traits { public: template::size_type Size> struct rebind_size { typedef typename sprout::container_transform_traits::template rebind_size::type const type; }; template struct rebind_type { typedef typename sprout::container_transform_traits::template rebind_type::type const type; }; }; template struct container_transform_traits { public: template::size_type Size> struct rebind_size { public: typedef T type[Size]; }; template struct rebind_type { public: typedef Type type[N]; }; }; template struct container_transform_traits { public: template::size_type Size> struct rebind_size { public: typedef T const type[Size]; }; template struct rebind_type { public: typedef Type type[N]; }; }; } // namespace sprout #endif // #ifndef SPROUT_CONTAINER_CONTAINER_TRANSFORM_TRAITS_HPP