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

Update docs with type requirements

This commit is contained in:
Paul
2014-09-03 18:55:00 -04:00
parent 3c970a37ca
commit 4427c033f7
16 changed files with 163 additions and 21 deletions

View File

@@ -23,10 +23,17 @@
/// --------
///
/// template<class T>
/// /* unspecified */ always(T value);
/// constexpr /* unspecified */ always(T value);
///
/// template<class T>
/// /* unspecified */ always_ref(T value);
/// constexpr /* unspecified */ always_ref(T& value);
///
/// Requirements
/// ------------
///
/// T must be:
///
/// CopyConstructible
///
/// Example
/// -------

View File

@@ -23,8 +23,16 @@
/// Synopsis
/// --------
///
/// template<class F1, class F2, ...>
/// compose_adaptor<F1, F2, ...> compose(F1 f1, F2 f2, ...);
/// template<class... Fs>
/// constexpr compose_adaptor<Fs...> compose(Fs... fs);
///
/// Requirements
/// ------------
///
/// Fs must be:
///
/// FunctionObject
/// MoveConstructible
///
/// Example
/// -------

View File

@@ -22,7 +22,24 @@
/// Note: This is different than the `match` function adaptor, which can lead
/// to ambiguities. Instead, `conditional` will call the first function that
/// is callable, regardless if there is another function that could be called
/// as well. So, for example:
/// as well.
///
/// Synopsis
/// --------
///
/// template<class... Fs>
/// constexpr conditional_adaptor<Fs...> conditional(Fs... fs);
///
/// Requirements
/// ------------
///
/// Fs must be:
///
/// FunctionObject
/// MoveConstructible
///
/// Example
/// -------
///
/// struct for_ints
/// {
@@ -49,13 +66,6 @@
///
/// So, the order of the functions in the `conditional_adaptor` are very important
/// to how the function is chosen.
///
/// Synopsis
/// --------
///
/// template<class F1, class F2, ...>
/// conditional_adaptor<F1, F2, ...> conditional(F1 f1, F2 f2, ...);
///
#include <fit/is_callable.h>
#include <fit/reveal.h>

View File

@@ -15,7 +15,11 @@
/// -----------
///
/// The `fix` function adaptor implements a fixed-point combinator. This can be
/// used to write recursive functions.
/// used to write recursive functions.
///
/// Note: Compilers are too eager to instantiate templates when using
/// constexpr, which causes the compiler to reach its internal instantiation
/// limit. So, unfortunately, `fix` cannot be used for `constexpr functions.
///
/// Synopsis
/// --------
@@ -23,6 +27,14 @@
/// template<class F>
/// fix_adaptor<F> fix(F f);
///
/// Requirements
/// ------------
///
/// F must be:
///
/// FunctionObject
/// MoveConstructible
///
/// Example
/// -------
///

View File

@@ -23,6 +23,14 @@
/// template<class F>
/// fuse_adaptor<F> fuse(F f);
///
/// Requirements
/// ------------
///
/// F must be:
///
/// FunctionObject
/// MoveConstructible
///
/// Example
/// -------
///

View File

@@ -27,6 +27,14 @@
/// template<template <class...> class F>
/// class implicit<F>;
///
/// Requirements
/// ------------
///
/// F must be a template class, that is a:
///
/// FunctionObject
/// DefaultConstructible
///
/// Example
/// -------
///

View File

@@ -22,6 +22,18 @@
/// template<class F, class Sequence>
/// auto invoke(F f, const Sequence& seq);
///
/// Requirements
/// ------------
///
/// F must be:
///
/// FunctionObject
/// MoveConstructible
///
/// Sequence must be a:
///
/// TupleSequence
///
/// Example
/// -------
///

View File

@@ -29,7 +29,15 @@
/// --------
///
/// template<class F>
/// lazy_adaptor<F> lazy(F f);
/// constexpr lazy_adaptor<F> lazy(F f);
///
/// Requirements
/// ------------
///
/// F must be:
///
/// FunctionObject
/// MoveConstructible
///
/// Example
/// -------

View File

@@ -22,8 +22,16 @@
/// Synopsis
/// --------
///
/// template<class F1, class F2, ...>
/// match_adaptor<F1, F2, ...> match(F1 f1, F2 f2, ...);
/// template<class... Fs>
/// constexpr match_adaptor<Fs...> match(Fs...fs);
///
/// Requirements
/// ------------
///
/// Fs must be:
///
/// FunctionObject
/// MoveConstructible
///
/// Example
/// -------

View File

@@ -29,6 +29,14 @@
/// template<class F>
/// mutable_adaptor<F> mutable_(F f)
///
/// Requirements
/// ------------
///
/// F must be:
///
/// FunctionObject
/// MoveConstructible
///
#include <fit/returns.h>
#include <fit/detail/delegate.h>

View File

@@ -23,7 +23,20 @@
/// --------
///
/// template<class Projection, class F>
/// on_adaptor<Projection, F> on(Projection p, F f);
/// constexpr on_adaptor<Projection, F> on(Projection p, F f);
///
/// Requirements
/// ------------
///
/// Projection must be:
///
/// UnaryFunctionObject
/// MoveConstructible
///
/// F must be:
///
/// FunctionObject
/// MoveConstructible
///
/// Example
/// -------

View File

@@ -25,7 +25,15 @@
/// --------
///
/// template<class F>
/// partial_adaptor<F> partial(F f);
/// constexpr partial_adaptor<F> partial(F f);
///
/// Requirements
/// ------------
///
/// F must be:
///
/// FunctionObject
/// MoveConstructible
///
/// Example
/// -------

View File

@@ -24,7 +24,15 @@
/// --------
///
/// template<class F>
/// pipable_adaptor<F> pipable(F f);
/// constexpr pipable_adaptor<F> pipable(F f);
///
/// Requirements
/// ------------
///
/// F must be:
///
/// FunctionObject
/// MoveConstructible
///
/// Example
/// -------

View File

@@ -26,6 +26,14 @@
/// template<class F>
/// reveal_adaptor<F> reveal(F f);
///
/// Requirements
/// ------------
///
/// Fs must be:
///
/// FunctionObject
/// MoveConstructible
///
#include <fit/returns.h>
#include <fit/is_callable.h>
@@ -109,7 +117,7 @@ struct reveal_adaptor: F
template<class F>
reveal_adaptor<F> reveal(F f)
{
return reveal_adaptor<F>(f);
return reveal_adaptor<F>(std::move(f));
}
}

View File

@@ -27,6 +27,14 @@
/// template<class F>
/// class static_;
///
/// Requirements
/// ------------
///
/// F must be:
///
/// FunctionObject
/// DefaultConstructible
///
/// Example
/// -------
///

View File

@@ -21,7 +21,15 @@
/// --------
///
/// template<class F>
/// variadic_adaptor<F> variadic(F f);
/// constexpr variadic_adaptor<F> variadic(F f);
///
/// Requirements
/// ------------
///
/// F must be:
///
/// FunctionObject
/// MoveConstructible
///
#include <fit/detail/ref_tuple.h>