2013-08-08 09:54:33 +00:00
|
|
|
/*=============================================================================
|
2019-01-07 08:47:17 +00:00
|
|
|
Copyright (c) 2011-2019 Bolero MURAKAMI
|
2013-08-08 09:54: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)
|
|
|
|
=============================================================================*/
|
2012-06-16 06:35:10 +00:00
|
|
|
#ifndef SPROUT_RANGE_ADAPTOR_DEEP_COPIED_HPP
|
|
|
|
#define SPROUT_RANGE_ADAPTOR_DEEP_COPIED_HPP
|
|
|
|
|
|
|
|
#include <sprout/config.hpp>
|
|
|
|
#include <sprout/container/traits.hpp>
|
|
|
|
#include <sprout/container/functions.hpp>
|
|
|
|
#include <sprout/utility/forward.hpp>
|
|
|
|
|
|
|
|
namespace sprout {
|
|
|
|
namespace adaptors {
|
|
|
|
//
|
|
|
|
// deep_copied_forwarder
|
|
|
|
//
|
|
|
|
class deep_copied_forwarder {};
|
|
|
|
|
|
|
|
//
|
|
|
|
// deep_copied
|
|
|
|
//
|
|
|
|
namespace {
|
2012-12-17 14:10:23 +00:00
|
|
|
SPROUT_STATIC_CONSTEXPR sprout::adaptors::deep_copied_forwarder deep_copied = {};
|
2012-06-16 06:35:10 +00:00
|
|
|
} // anonymous-namespace
|
|
|
|
|
|
|
|
//
|
|
|
|
// operator|
|
|
|
|
//
|
|
|
|
template<typename Range>
|
|
|
|
inline SPROUT_CONSTEXPR typename sprout::container_construct_traits<
|
|
|
|
typename std::remove_reference<Range>::type
|
|
|
|
>::copied_type
|
2013-07-22 13:00:09 +00:00
|
|
|
operator|(Range&& lhs, sprout::adaptors::deep_copied_forwarder const&) {
|
2014-02-22 07:32:51 +00:00
|
|
|
return sprout::deep_copy(SPROUT_FORWARD(Range, lhs));
|
2012-06-16 06:35:10 +00:00
|
|
|
}
|
|
|
|
} // namespace adaptors
|
|
|
|
} // namespace sprout
|
|
|
|
|
|
|
|
#endif // #ifndef SPROUT_RANGE_ADAPTOR_DEEP_COPIED_HPP
|