2
0
mirror of https://github.com/boostorg/hof.git synced 2026-01-25 06:12:25 +00:00

Add documentation for flip

This commit is contained in:
Paul
2015-02-25 10:25:27 -05:00
parent 9370c82b2e
commit 9508599410
4 changed files with 59 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ extract compose
extract conditional
extract each_arg
extract fix
extract flip
extract function
extract fuse
extract identity

28
doc/src/flip.md Normal file
View File

@@ -0,0 +1,28 @@
flip
====
Description
-----------
The `flip` function adaptor swaps the first two parameters.
Synopsis
--------
template<class F>
flip_adaptor<F> flip(F f);
Requirements
------------
F must be:
BinaryFunctionObject
MoveConstructible
Example
-------
int r = fit::flip(fit::_ - fit::_)(2, 5);
assert(r == 3);

View File

@@ -8,6 +8,35 @@
#ifndef FIT_GUARD_FLIP_H
#define FIT_GUARD_FLIP_H
/// flip
/// ====
///
/// Description
/// -----------
///
/// The `flip` function adaptor swaps the first two parameters.
///
/// Synopsis
/// --------
///
/// template<class F>
/// flip_adaptor<F> flip(F f);
///
/// Requirements
/// ------------
///
/// F must be:
///
/// BinaryFunctionObject
/// MoveConstructible
///
/// Example
/// -------
///
/// int r = fit::flip(fit::_ - fit::_)(2, 5);
/// assert(r == 3);
///
#include <fit/returns.h>
#include <fit/reveal.h>

View File

@@ -16,6 +16,7 @@ pages:
- ['compose.md', 'Adaptors', 'compose']
- ['conditional.md', 'Adaptors', 'conditional']
- ['fix.md', 'Adaptors', 'fix']
- ['flip.md', 'Adaptors', 'flip']
- ['fuse.md', 'Adaptors', 'fuse']
- ['implicit.md', 'Adaptors', 'implicit']
- ['indirect.md', 'Adaptors', 'indirect']