1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

fixed_container_traits 仕様変更

This commit is contained in:
bolero-MURAKAMI 2011-10-30 17:40:35 +09:00
parent 9a229b824f
commit 2168f05433
43 changed files with 174 additions and 202 deletions

View file

@ -1,28 +1,21 @@
#ifndef SPROUT_FIXED_CONTAINER_CLONE_HPP
#define SPROUT_FIXED_CONTAINER_CLONE_HPP
#include <type_traits>
#include <sprout/config.hpp>
#include <sprout/fixed_container/traits.hpp>
#include <sprout/utility/forward.hpp>
namespace sprout {
//
// clone
//
template<typename Container>
inline typename sprout::fixed_container_traits<Container>::clone_type clone(Container& cont) {
return sprout::clone_functor<Container>().template operator()(cont);
}
template<typename Container, typename... Args>
SPROUT_CONSTEXPR inline typename sprout::fixed_container_traits<Container>::clone_type clone(Container const& cont) {
return sprout::clone_functor<Container>().template operator()(cont);
}
//
// cclone
//
template<typename Container>
SPROUT_CONSTEXPR inline typename sprout::fixed_container_traits<Container>::clone_type cclone(Container const& cont) {
return sprout::clone_functor<Container>().template operator()(cont);
SPROUT_CONSTEXPR inline typename sprout::fixed_container_traits<
typename std::remove_reference<Container>::type
>::clone_type clone(Container&& cont) {
typedef typename std::decay<Container>::type container_type;
return sprout::clone_functor<container_type>().template operator()(sprout::forward<Container>(cont));
}
} // namespace sprout