Skip to content

Commit

Permalink
Add semantics for lazy and protect for issue #89
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 committed Jan 30, 2017
1 parent 866a9a8 commit 43a9369
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/fit/lazy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@
/// template<class F>
/// constexpr lazy_adaptor<F> lazy(F f);
///
/// Semantics
/// ---------
///
/// assert(lazy(f)(xs...) == std::bind(f, xs...))
/// assert(lazy(f)(xs...)() == f(xs...))
/// assert(lazy(f)(_1)(x) == f(x))
/// assert(lazy(f)(lazy(g)(_1))(x) == f(g(x)))
///
/// Requirements
/// ------------
///
Expand All @@ -52,6 +60,11 @@
/// assert(increment(5) == 6);
/// }
///
/// References
/// ----------
///
/// * [std::bind](http://en.cppreference.com/w/cpp/utility/functional/bind)
///

#include <fit/arg.hpp>
#include <fit/conditional.hpp>
Expand Down
5 changes: 5 additions & 0 deletions include/fit/protect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
/// template<class F>
/// constexpr protect_adaptor<F> protect(F f);
///
/// Semantics
/// ---------
///
/// assert(lazy(f)(protect(lazy(g)(_1)))() == f(lazy(g)(_1)))
///
/// Requirements
/// ------------
///
Expand Down

0 comments on commit 43a9369

Please sign in to comment.