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:
@@ -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
28
doc/src/flip.md
Normal 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);
|
||||
|
||||
29
fit/flip.h
29
fit/flip.h
@@ -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>
|
||||
|
||||
|
||||
@@ -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']
|
||||
|
||||
Reference in New Issue
Block a user