diff --git a/doc/gendoc b/doc/gendoc index 7dfa2ca..1a2ee78 100755 --- a/doc/gendoc +++ b/doc/gendoc @@ -14,6 +14,7 @@ extract fuse extract identity extract implicit extract indirect +extract infix extract invoke extract is_callable extract lambda diff --git a/doc/src/infix.md b/doc/src/infix.md new file mode 100644 index 0000000..af283e9 --- /dev/null +++ b/doc/src/infix.md @@ -0,0 +1,40 @@ +infix +===== + +Description +----------- + +The `infix` function adaptor allows the function to be used as an infix +operator. The operator must be placed inside the angle brackets(ie `<` +and `>`). + +Synopsis +-------- + + template + constexpr infix_adaptor infix(F f); + +Requirements +------------ + +F must be: + + BinaryFunctionObject + MoveConstructible + +Example +------- + + struct plus_f + { + template + T operator()(T x, U y) const + { + return x+y; + } + }; + + constexpr infix_adaptor plus = {}; + int r = 3 2; + assert(r, 5); +