### Find First Whitespace Character with Boost.Lambda2 Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 This C++ example showcases Boost.Lambda2 for finding the first whitespace character in a C-style string. It employs a compound predicate '_1 == ' ' || _1 == '\t' || _1 == '\r' || _1 == '\n'' for std::find_if. Dependencies include Boost.Lambda2 and C++14. ```cpp #include #include char const * find_whitespace( char const * first, char const * last ) { using namespace boost::lambda2; return std::find_if( first, last, _1 == ' ' || _1 == '\t' || _1 == '\r' || _1 == '\n' ); } ``` -------------------------------- ### Printing Map Elements Using Projections in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Demonstrates how to use the 'first' and 'second' projection function objects with std::for_each to print key-value pairs from a std::map. It utilizes Boost Lambda2 syntax for concise iteration. ```cpp void print( std::map const & m ) { using namespace boost::lambda2; std::for_each( m.begin(), m.end(), std::cout << _1->*first << ": " << _1->*second << '\n' ); } ``` -------------------------------- ### Boost.Lambda2 Placeholders and Operators Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Defines placeholders like _1, _2, etc., and overloads for arithmetic, relational, logical, bitwise, unary, and compound assignment operators. These are used to construct lambda expressions. ```cpp namespace boost { namespace lambda2 { // placeholders template struct lambda2_arg; inline constexpr lambda2_arg<1> _1{}; inline constexpr lambda2_arg<2> _2{}; inline constexpr lambda2_arg<3> _3{}; inline constexpr lambda2_arg<4> _4{}; inline constexpr lambda2_arg<5> _5{}; inline constexpr lambda2_arg<6> _6{}; inline constexpr lambda2_arg<7> _7{}; inline constexpr lambda2_arg<8> _8{}; inline constexpr lambda2_arg<9> _9{}; // arithmetic operators template auto operator+( A && a, B && b ); template auto operator-( A && a, B && b ); template auto operator*( A && a, B && b ); template auto operator/( A && a, B && b ); template auto operator%( A && a, B && b ); template auto operator-( A && a ); // relational operators template auto operator==( A && a, B && b ); template auto operator!=( A && a, B && b ); template auto operator>( A && a, B && b ); template auto operator<( A && a, B && b ); template auto operator>=( A && a, B && b ); template auto operator<=( A && a, B && b ); // logical operators template auto operator&&( A && a, B && b ); template auto operator||( A && a, B && b ); template auto operator!( A && a ); // bitwise operators template auto operator&( A && a, B && b ); template auto operator|( A && a, B && b ); template auto operator^( A && a, B && b ); template auto operator~( A && a ); template auto operator<<( A && a, B && b ); template auto operator>>( A && a, B && b ); // additional unary operators template auto operator+( A && a ); template auto operator*( A && a ); template auto operator++( A && a ); template auto operator--( A && a ); template auto operator++( A && a, int ); template auto operator--( A && a, int ); // compound assignment operators template auto operator+=( A && a, B && b ); template auto operator-=( A && a, B && b ); template auto operator*=( A && a, B && b ); template auto operator/=( A && a, B && b ); template auto operator%=( A && a, B && b ); template auto operator&=( A && a, B && b ); template auto operator|=( A && a, B && b ); template auto operator^=( A && a, B && b ); template auto operator<<=( A && a, B && b ); template auto operator>>=( A && a, B && b ); // additional binary operators template auto operator->*( A && a, B && b ); // projections inline constexpr /unspecified/ first{}; inline constexpr /unspecified/ second{}; } // namespace lambda2 } // namespace boost ``` -------------------------------- ### Boost Lambda2 Placeholders and Operators Declaration (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 This snippet declares the core placeholders (_1 to _9) and overloads for arithmetic, relational, logical, bitwise, unary, and compound assignment operators within the boost::lambda2 namespace. These are fundamental building blocks for creating lambda expressions and function objects. ```cpp namespace boost { namespace lambda2 { // placeholders template struct lambda2_arg; inline constexpr lambda2_arg<1> _1{}; inline constexpr lambda2_arg<2> _2{}; inline constexpr lambda2_arg<3> _3{}; inline constexpr lambda2_arg<4> _4{}; inline constexpr lambda2_arg<5> _5{}; inline constexpr lambda2_arg<6> _6{}; inline constexpr lambda2_arg<7> _7{}; inline constexpr lambda2_arg<8> _8{}; inline constexpr lambda2_arg<9> _9{}; // arithmetic operators template auto operator+( A && a, B && b ); template auto operator-( A && a, B && b ); template auto operator*( A && a, B && b ); template auto operator/( A && a, B && b ); template auto operator%( A && a, B && b ); template auto operator-( A && a ); // relational operators template auto operator==( A && a, B && b ); template auto operator!=( A && a, B && b ); template auto operator>( A && a, B && b ); template auto operator<( A && a, B && b ); template auto operator>=( A && a, B && b ); template auto operator<=( A && a, B && b ); // logical operators template auto operator&&( A && a, B && b ); template auto operator||( A && a, B && b ); template auto operator!( A && a ); // bitwise operators template auto operator&( A && a, B && b ); template auto operator|( A && a, B && b ); template auto operator^( A && a, B && b ); template auto operator~( A && a ); template auto operator<<( A && a, B && b ); template auto operator>>( A && a, B && b ); // additional unary operators template auto operator+( A && a ); template auto operator*( A && a ); template auto operator++( A && a ); template auto operator--( A && a ); template auto operator++( A && a, int ); template auto operator--( A && a, int ); // compound assignment operators template auto operator+=( A && a, B && b ); template auto operator-=( A && a, B && b ); template auto operator*=( A && a, B && b ); template auto operator/=( A && a, B && b ); template auto operator%=( A && a, B && b ); template auto operator&=( A && a, B && b ); template auto operator|=( A && a, B && b ); template auto operator^=( A && a, B && b ); template auto operator<<=( A && a, B && b ); template auto operator>>=( A && a, B && b ); // additional binary operators template auto operator->*( A && a, B && b ); // projections inline constexpr /unspecified/ first{}; inline constexpr /unspecified/ second{}; } // namespace lambda2 } // namespace boost ``` -------------------------------- ### lambda2_arg Placeholder Type Definition (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Defines the lambda2_arg template, which serves as the base type for placeholders like _1. It supports function call and subscript operators, enabling direct use as function objects and integration with std::bind. ```cpp template struct lambda2_arg { template decltype(auto) operator()( A&&... a ) const noexcept; template auto operator[]( T&& t ) const; }; ``` -------------------------------- ### lambda2_arg Subscript Operator Implementation (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Implements the subscript operator for lambda2_arg. This enables syntax like _1[x] and _1[_2], translating them into std::bind expressions for more complex functional compositions. ```cpp template auto operator[]( T&& t ) const { // Returns: std::bind( fn, *this, std::forward(t) );, where fn is a function object such that fn(x, y) returns x[y]. return std::bind( fn, *this, std::forward(t) ); } ``` -------------------------------- ### Lambda2 Placeholder Details Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Details the `lambda2_arg` structure, which serves as the type for Boost.Lambda2 placeholders. It explains the `operator()` for direct use as function objects and `operator[]` for expression composition. ```cpp template struct lambda2_arg { template decltype(auto) operator()( A&&... a ) const noexcept; template auto operator[]( T&& t ) const; }; // Specialization for std::is_placeholder to work with std::bind // Example usage: _1(x, y) returns x // Example usage: _1[x] or _1[_2] ``` ```cpp template decltype(auto) operator()( A&&... a ) const noexcept { // Returns: std::get( std::tuple( std::forward(a)…​ ) ); return {}; // Placeholder implementation } ``` ```cpp template auto operator[]( T&& t ) const { // Returns: std::bind( fn, *this, std::forward(t) );, where fn is a function object such that fn(x, y) returns x[y]. return {}; // Placeholder implementation } ``` -------------------------------- ### Projections 'first' and 'second' in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Provides projection function objects 'first' and 'second'. 'first(x)' returns the first element of a tuple or pair, and 'second(x)' returns the second element. These are useful for accessing elements within collections. ```cpp inline constexpr /unspecified/ first{}; ``` ```cpp inline constexpr /unspecified/ second{}; ``` -------------------------------- ### Count Even Numbers using Boost.Lambda2 Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 This C++ code snippet demonstrates how to use Boost.Lambda2 to count even numbers within a range. It utilizes the '_1 % 2 == 0' expression as a predicate for std::count_if, requiring the Boost.Lambda2 header and C++14 support. ```cpp #include #include using namespace boost::lambda2; int count_even( int const * first, int const * last ) { return std::count_if( first, last, _1 % 2 == 0 ); } ``` -------------------------------- ### Additional Binary Operators in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Implements additional binary operators, specifically '->*', intended for use with projection function objects like member pointers. It utilizes std::bind to apply the member access operation. ```cpp template auto operator->*( A && a, B && b ); ``` -------------------------------- ### lambda2_arg Function Call Operator Implementation (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Implements the function call operator for lambda2_arg. This allows placeholders to be invoked like functions, forwarding arguments to std::tuple and extracting elements based on the placeholder index. ```cpp template decltype(auto) operator()( A&&... a ) const noexcept { // Returns: std::get( std::tuple( std::forward(a)…​ ) ); return std::get( std::tuple( std::forward(a)…​ ) ); } ``` -------------------------------- ### Bitwise AND, OR, XOR Operators in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overloads for bitwise AND, OR, and XOR operations. Each returns a std::bind expression using the corresponding standard bitwise functor (std::bit_and, std::bit_or, std::bit_xor). ```cpp template auto operator&( A && a, B && b ); // Returns: std::bind( std::bit_and<>(), std::forward(a), std::forward(b) ); template auto operator|( A && a, B && b ); // Returns: std::bind( std::bit_or<>(), std::forward(a), std::forward(b) ); template auto operator^( A && a, B && b ); // Returns: std::bind( std::bit_xor<>(), std::forward(a), std::forward(b) ); ``` -------------------------------- ### Arithmetic Binary Operators in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overloads for addition, subtraction, multiplication, division, and modulus operations. Each operator accepts two forwarded arguments and returns a std::bind expression using the corresponding standard functor (std::plus, std::minus, std::multiplies, std::divides, std::modulus). ```cpp template auto operator+( A && a, B && b ); // Returns: std::bind( std::plus<>(), std::forward(a), std::forward(b) ); template auto operator-( A && a, B && b ); // Returns: std::bind( std::minus<>(), std::forward(a), std::forward(b) ); template auto operator*( A && a, B && b ); // Returns: std::bind( std::multiplies<>(), std::forward(a), std::forward(b) ); template auto operator/( A && a, B && b ); // Returns: std::bind( std::divides<>(), std::forward(a), std::forward(b) ); template auto operator%( A && a, B && b ); // Returns: std::bind( std::modulus<>(), std::forward(a), std::forward(b) ); ``` -------------------------------- ### Relational Operators in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overloads for equality, inequality, greater than, less than, greater-or-equal, and less-or-equal comparisons. Each returns a std::bind expression using the corresponding standard comparison functor. ```cpp template auto operator==( A && a, B && b ); // Returns: std::bind( std::equal_to<>(), std::forward(a), std::forward(b) ); template auto operator!=( A && a, B && b ); // Returns: std::bind( std::not_equal_to<>(), std::forward(a), std::forward(b) ); template auto operator>( A && a, B && b ); // Returns: std::bind( std::greater<>(), std::forward(a), std::forward(b) ); template auto operator<( A && a, B && b ); // Returns: std::bind( std::less<>(), std::forward(a), std::forward(b) ); template auto operator>=( A && a, B && b ); // Returns: std::bind( std::greater_equal<>(), std::forward(a), std::forward(b) ); template auto operator<=( A && a, B && b ); // Returns: std::bind( std::less_equal<>(), std::forward(a), std::forward(b) ); ``` -------------------------------- ### Boost Lambda2 Arithmetic Operators (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Implements overloaded arithmetic operators (+, -, *, /, %) using std::bind and functional objects. These operators take two arguments and return a bind expression representing the corresponding arithmetic operation. ```C++ template auto operator+( A && a, B && b ); // Returns: std::bind( std::plus<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator-( A && a, B && b ); // Returns: std::bind( std::minus<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator*( A && a, B && b ); // Returns: std::bind( std::multiplies<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator/( A && a, B && b ); // Returns: std::bind( std::divides<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator%( A && a, B && b ); // Returns: std::bind( std::modulus<>(), std::forward(a), std::forward(b) ); ``` -------------------------------- ### Logical Operators in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overloads for logical AND, logical OR, and logical NOT operations. Binary operators return std::bind expressions using std::logical_and and std::logical_or; unary NOT uses std::logical_not. ```cpp template auto operator&&( A && a, B && b ); // Returns: std::bind( std::logical_and<>(), std::forward(a), std::forward(b) ); template auto operator||( A && a, B && b ); // Returns: std::bind( std::logical_or<>(), std::forward(a), std::forward(b) ); template auto operator!( A && a ); // Returns: std::bind( std::logical_not<>(), std::forward(a) ); ``` -------------------------------- ### Boost Lambda2 Logical Operators (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Implements overloaded logical operators (&&, ||, !) using std::bind and functional objects. These operators enable logical operations in a functional programming context. ```C++ template auto operator&&( A && a, B && b ); // Returns: std::bind( std::logical_and<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator|=( A && a, B && b ); // Returns: std::bind( std::logical_or<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator!( A && a ); // Returns: std::bind( std::logical_not<>(), std::forward(a) ); ``` -------------------------------- ### Boost Lambda2 Relational Operators (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Implements overloaded relational operators (==, !=, >, <, >=, <=) using std::bind and functional objects. These operators facilitate comparisons in a functional style. ```C++ template auto operator==( A && a, B && b ); // Returns: std::bind( std::equal_to<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator!=( A && a, B && b ); // Returns: std::bind( std::not_equal_to<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator>( A && a, B && b ); // Returns: std::bind( std::greater<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator<( A && a, B && b ); // Returns: std::bind( std::less<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator>=( A && a, B && b ); // Returns: std::bind( std::greater_equal<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator<=( A && a, B && b ); // Returns: std::bind( std::less_equal<>(), std::forward(a), std::forward(b) ); ``` -------------------------------- ### Boost Lambda2 Bitwise Operators (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Implements overloaded bitwise operators (&, |, ^, ~, <<, >>) using std::bind and functional objects. These operators allow for bitwise manipulations within the lambda2 framework. ```C++ template auto operator&( A && a, B && b ); // Returns: std::bind( std::bit_and<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator|( A && a, B && b ); // Returns: std::bind( std::bit_or<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator^( A && a, B && b ); // Returns: std::bind( std::bit_xor<>(), std::forward(a), std::forward(b) ); ``` ```C++ template auto operator~( A && a ); // Returns: std::bind( std::bit_not<>(), std::forward(a) ); ``` ```C++ template auto operator<<( A && a, B && b ); // Returns: std::bind( fn, std::forward(a), std::forward(b) );, where fn is a function object such that fn(x, y) returns x << y. ``` ```C++ template auto operator>>( A && a, B && b ); // Returns: std::bind( fn, std::forward(a), std::forward(b) );, where fn is a function object such that fn(x, y) returns x >> y. ``` -------------------------------- ### Compound Assignment Operators in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Defines compound assignment operators using std::bind for applying operations like +=, -=, etc. It takes two arguments and returns a bound function object that performs the operation x @= y. ```cpp template auto operator@=( A && a, B && b ); ``` -------------------------------- ### Bitwise Shift Operators in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overloads for left shift and right shift operations. Each returns a std::bind expression with a custom function object that performs the corresponding shift operation (x << y or x >> y). ```cpp template auto operator<<( A && a, B && b ); // Returns: std::bind( fn, std::forward(a), std::forward(b) ); // where fn is a function object such that fn(x, y) returns x << y template auto operator>>( A && a, B && b ); // Returns: std::bind( fn, std::forward(a), std::forward(b) ); // where fn is a function object such that fn(x, y) returns x >> y ``` -------------------------------- ### Boost Lambda2 Increment/Decrement Operators (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Implements overloaded increment (++) and decrement (--) operators, both pre- and post-increment/decrement, using std::bind. These operators allow for functional manipulation of mutable states. ```C++ template auto operator++( A && a ); // Returns: std::bind( fn, std::forward(a) );, where fn is a function object such that fn(x) returns ++x. ``` ```C++ template auto operator--( A && a ); // Returns: std::bind( fn, std::forward(a) );, where fn is a function object such that fn(x) returns --x. ``` ```C++ template auto operator++( A && a, int ); // Returns: std::bind( fn, std::forward(a) );, where fn is a function object such that fn(x) returns x++. ``` ```C++ template auto operator--( A && a, int ); // Returns: std::bind( fn, std::forward(a) );, where fn is a function object such that fn(x) returns x--. ``` -------------------------------- ### Boost Lambda2 Dereference and Address-of Operators (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Implements overloaded dereference (*) and address-of (&) operators using std::bind. These operators are useful for working with pointers and references in a functional style. ```C++ template auto operator*( A && a ); // Returns: std::bind( fn, std::forward(a) );, where fn is a function object such that fn(x) returns *x. ``` -------------------------------- ### Unary Plus Operator in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overload for unary plus. Accepts a single forwarded argument and returns a std::bind expression with a custom function object that applies unary plus (+x). ```cpp template auto operator+( A && a ); // Returns: std::bind( fn, std::forward(a) ); // where fn is a function object such that fn(x) returns +x ``` -------------------------------- ### Boost Lambda2 Unary Arithmetic Operators (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Implements overloaded unary arithmetic operators (+, -) using std::bind and functional objects. These operators take a single argument and return a bind expression representing the corresponding unary operation. ```C++ template auto operator-( A && a ); // Returns: std::bind( std::negate<>(), std::forward(a) ); ``` ```C++ template auto operator+( A && a ); // Returns: std::bind( fn, std::forward(a) );, where fn is a function object such that fn(x) returns +x. ``` -------------------------------- ### Unary Pre-increment Operator in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overload for pre-increment. Accepts a single forwarded argument and returns a std::bind expression with a custom function object that performs pre-increment (++x). ```cpp template auto operator++( A && a ); // Returns: std::bind( fn, std::forward(a) ); // where fn is a function object such that fn(x) returns ++x ``` -------------------------------- ### Unary Post-increment Operator in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overload for post-increment (distinguished by int parameter). Accepts a single forwarded argument and an int flag, returning a std::bind expression with a custom function object that performs post-increment (x++). ```cpp template auto operator++( A && a, int ); // Returns: std::bind( fn, std::forward(a) ); // where fn is a function object such that fn(x) returns x++ ``` -------------------------------- ### Boost Lambda2 Operator Resolution Requirement (C++) Source: https://www.boost.org/doc/libs/latest/libs/lambda2/doc/html/lambda2 Specifies the common requirement for all operators in Boost Lambda2. Operators are only considered if at least one operand is a placeholder or a std::bind expression, ensuring correct overload resolution in functional contexts. ```cpp All operators defined in the subsequent sections only participate in overload resolution if at least one of their operands is such that for its unqualified type T, the expression std::is_placeholder::value || std::is_bind_expression::value is true. ``` -------------------------------- ### Arithmetic Unary Negation Operator in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overload for unary negation. Accepts a single forwarded argument and returns a std::bind expression using std::negate functor for functional composition. ```cpp template auto operator-( A && a ); // Returns: std::bind( std::negate<>(), std::forward(a) ); ``` -------------------------------- ### Lambda2 Common Requirements for Operator Resolution Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Specifies the condition for operators in Boost.Lambda2 to participate in overload resolution. It requires operands to be placeholders or bind expressions. ```cpp All operators defined in the subsequent sections only participate in overload resolution if at least one of their operands is such that for its unqualified type T, the expression std::is_placeholder::value || std::is_bind_expression::value is true. ``` -------------------------------- ### Bitwise NOT Operator in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overload for bitwise NOT (complement). Accepts a single forwarded argument and returns a std::bind expression using std::bit_not functor. ```cpp template auto operator~( A && a ); // Returns: std::bind( std::bit_not<>(), std::forward(a) ); ``` -------------------------------- ### Unary Pre-decrement Operator in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overload for pre-decrement. Accepts a single forwarded argument and returns a std::bind expression with a custom function object that performs pre-decrement (--x). ```cpp template auto operator--( A && a ); // Returns: std::bind( fn, std::forward(a) ); // where fn is a function object such that fn(x) returns --x ``` -------------------------------- ### Unary Post-decrement Operator in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overload for post-decrement (distinguished by int parameter). Accepts a single forwarded argument and an int flag, returning a std::bind expression with a custom function object that performs post-decrement (x--). ```cpp template auto operator--( A && a, int ); // Returns: std::bind( fn, std::forward(a) ); // where fn is a function object such that fn(x) returns x-- ``` -------------------------------- ### Unary Dereference Operator in C++ Source: https://www.boost.org/doc/libs/latest/libs/lambda2/index Template operator overload for pointer dereference. Accepts a single forwarded argument and returns a std::bind expression with a custom function object that dereferences the pointer (*x). ```cpp template auto operator*( A && a ); // Returns: std::bind( fn, std::forward(a) ); // where fn is a function object such that fn(x) returns *x ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.