Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 6d41d6261e
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (25 sloc) 0.511 kb
#include <hn/lib.hpp>
struct main_impl
{
template <typename t1, typename t2>
struct flip_impl
{
boost::function<t2 (t1)> f;
t2 flipped(t1 x)
{
return f(x);
};
};
template <typename t1, typename t2>
static boost::function<t2 (t1)> flip(boost::function<t2 (t1)> f)
{
typedef flip_impl<t1, t2> local;
local impl = { f };
return hn::bind(impl, &local::flipped);
};
};
int main()
{
typedef main_impl local;
return (local::flip<int, int>(&ff::incr))(3);
};
Jump to Line
Something went wrong with that request. Please try again.