Skip to content

Commit

Permalink
Small fixes in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pfultz2 committed Mar 29, 2016
1 parent 4ab5923 commit 0ef5ecd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/src/example_overloading.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ this:
));
}

The `id` parameter passed to the lambda is the [`identity`](identity.md) function. As explained in the article, this is used to delay the lookup of types by making it a dependent type(i.e. the type depends on a template parameter), which is necessary to avoid compile errors.
The `id` parameter passed to the lambda is the [`identity`](identity.md) function. As explained in the article, this is used to delay the lookup of types by making it a dependent type(i.e. the type depends on a template parameter), which is necessary to avoid compile errors. The [`eval`](eval.md) function that is called will pass this `identity` function to the lambdas.

The advantage of using the Fit library instead of the solution in Baptiste
Wicht's blog, is that [`conditional`](conditional.md) allows more than just two conditions. So if
Expand Down
4 changes: 2 additions & 2 deletions doc/src/example_variadic_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ We can write this simply by using the [`by`](by.md) adaptor:

FIT_STATIC_FUNCTION(print) = by(std::cout << _);

The [`by`](by.md) adaptor calls the function for each argument passed in. In this case, we write `std::cout << _` which uses the [placeholders](placeholders.md) to create a function that print to `std::cout`.
The [`by`](by.md) adaptor calls the function for each argument passed in. In this case, we write `std::cout << _` which uses the [placeholders](placeholders.md) to create a function that prints to `std::cout`.

We can also take binary functions and turn them easily into variadic functions
using [`compress`](compress.md), which will do a fold over the variadic parameters. So a variadic `max` function could be written like
Expand All @@ -22,5 +22,5 @@ this:
auto n = max(1, 2, 4, 3); // Returns 4
auto m = max(0.1, 0.2, 0.5, 0.4); // Returns 0.5

By using [`compress`](compress.md), `max(1, 2, 4, 3)` is called like `std::max(std::max(std::max(1, 2), 4), 3)` and `max(0.1, 0.2, 0.5, 0.4)` is called like `std::max(std::max(std::max(0.1, 0.2), 0.5), 0.4)`.
By using [`compress`](compress.md), `max(1, 2, 4, 3)` will call `std::max` like `std::max(std::max(std::max(1, 2), 4), 3)` and `max(0.1, 0.2, 0.5, 0.4)` will be called like `std::max(std::max(std::max(0.1, 0.2), 0.5), 0.4)`.

2 changes: 1 addition & 1 deletion doc/src/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The `FIT_STATIC_FUNCTION` declares a global variable following the best practice
Adaptors
--------

Now we have defined the function as a function object, we can add new "enhancements" to the function. One enhancement is to write "exentsion" methods. The proposal [N4165](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4165.pdf) for Unified Call Syntax(UFCS) in C++17 would have allowed a function call of `x.f(y)` to become `f(x, y)`. Instead we can use pipable function which would transform `x | f(y)` into `f(x, y)`. We could make the `sum` function pipable using the [`pipable`](pipable.md) adaptor:
Now we have defined the function as a function object, we can add new "enhancements" to the function. One enhancement is to write "exentsion" methods. The proposal [N4165](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4165.pdf) for Unified Call Syntax(UFCS) in C++17 would have allowed a function call of `x.f(y)` to become `f(x, y)`. Without UFCS in C++, we can instead use pipable function which would transform `x | f(y)` into `f(x, y)`. To make `sum_f` function pipable using the [`pipable`](pipable.md) adaptor, we can simply write :

FIT_STATIC_FUNCTION(sum) = pipable(sum_f());

Expand Down

0 comments on commit 0ef5ecd

Please sign in to comment.