mirror of
https://github.com/boostorg/hof.git
synced 2026-01-21 04:52:20 +00:00
18 lines
300 B
C++
18 lines
300 B
C++
#include <boost/hof/unpack.hpp>
|
|
|
|
struct foo
|
|
{};
|
|
|
|
namespace boost { namespace hof {
|
|
|
|
template<>
|
|
struct unpack_sequence<foo>
|
|
{
|
|
template<class F, class S>
|
|
constexpr static auto apply(F&&, S&& s) BOOST_HOF_RETURNS(s.bar);
|
|
};
|
|
}
|
|
|
|
int main() {
|
|
boost::hof::unpack(boost::hof::always(1))(foo{});
|
|
} |