Skip to content

Commit

Permalink
Add a note about capturing by value for lazy adaptor with a note std:…
Browse files Browse the repository at this point in the history
…:ref. This fixes issue #138 and #139
  • Loading branch information
pfultz2 committed Mar 22, 2016
1 parent 7cbab72 commit 9bc294e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/fit/lazy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
///
/// The `lazy` function adaptor returns a function object call wrapper for a
/// function. Calling this wrapper is equivalent to invoking the function. It
/// is a simple form of lambda expressions, but is constexpr friendly.
/// is a simple form of lambda expressions, but is constexpr friendly. By
/// default, `lazy` captures all of its variables by value, just like `bind`.
/// `std::ref` can be used to capture references instead.
///
/// Ultimately, calling `lazy(f)(x)` is the equivalent to calling
/// `std::bind(f, x)` except the lazy version can be called in a constexpr
Expand Down

0 comments on commit 9bc294e

Please sign in to comment.