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

add compost left_channel, right_channel

This commit is contained in:
bolero-MURAKAMI 2012-11-24 23:28:07 +09:00
parent 597d05563b
commit 7da0aa0343
4 changed files with 91 additions and 1 deletions

View file

@ -0,0 +1,44 @@
#ifndef SPROUT_COMPOST_FORMATS_LEFT_CHANNEL_HPP
#define SPROUT_COMPOST_FORMATS_LEFT_CHANNEL_HPP
#include <sprout/config.hpp>
#include <sprout/utility/forward.hpp>
#include <sprout/range/adaptor/steps.hpp>
namespace sprout {
namespace compost {
namespace formats {
//
// left_channel_forwarder
//
class left_channel_forwarder {};
//
// left_channel
//
namespace {
SPROUT_STATIC_CONSTEXPR sprout::compost::formats::left_channel_forwarder left_channel{};
} // anonymous-namespace
//
// operator|
//
template<typename Range, typename T>
inline SPROUT_CONSTEXPR auto
operator|(Range&& lhs, left_channel_forwarder const& rhs)
-> decltype(
sprout::forward<Range>(lhs)
| sprout::adaptors::steps(2)
)
{
return sprout::forward<Range>(lhs)
| sprout::adaptors::steps(2)
;
}
} // namespace formats
using sprout::compost::formats::left_channel;
} // namespace compost
} // namespace sprout
#endif // #ifndef SPROUT_COMPOST_FORMATS_LEFT_CHANNEL_HPP