Skip to content

Commit b7d4346

Browse files
author
Colin Robertson
authored
Merge pull request #830 from MicrosoftDocs/master636873221229986608
Fix git push error for protected CLA branch
2 parents 8cdf91f + c309325 commit b7d4346

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

docs/standard-library/functional-functions.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -615,22 +615,25 @@ int main()
615615
{
616616
Demo d{ 42 };
617617
Demo * pd{ &d };
618+
auto pmf = &Demo::difference;
619+
auto pmd = &Demo::n_;
618620
619-
// Invoke a function object (call operator).
621+
// Invoke a function object, like calling d( 3, -7 )
620622
std::invoke( d, 3, -7 );
621623
622-
// Invoke a member function or pointer to member function:
624+
// Invoke a member function, like calling
625+
// d.difference( 29 ) or (d.*pmf)( 29 )
623626
std::invoke( &Demo::difference, d, 29 );
624-
std::invoke( &Demo::difference, pd, 13 );
627+
std::invoke( pmf, pd, 13 );
625628
626-
// Invoke a data member on an object or pointer to object:
629+
// Invoke a data member, like access to d.n_ or d.*pmd
627630
std::cout << "d.n_: " << std::invoke( &Demo::n_, d ) << "\n";
628-
std::cout << "pd->n_: " << std::invoke( &Demo::n_, pd ) << "\n";
631+
std::cout << "pd->n_: " << std::invoke( pmd, pd ) << "\n";
629632
630-
// Invoke a stand-alone (free) function:
633+
// Invoke a stand-alone (free) function
631634
std::invoke( divisible_by_3, 42 );
632635
633-
// Invoke a lambda:
636+
// Invoke a lambda
634637
auto divisible_by_7 = []( int const i ) {
635638
std::cout << i << ( i % 7 == 0 ? " is" : " isn't" )
636639
<< " divisible by 7.\n";
@@ -1054,7 +1057,7 @@ Resorted vector v1 = ( 26500 19169 18467 6334 6262 6262 41 )
10541057

10551058
## <a name="not_fn"></a> not_fn
10561059

1057-
The `not_fn` function template takes a callable object and returns a callable object. When the returned callable object is later invoked with some arguments, it passes them to the original callable object, and logically negates the result. It preserves the const qualification and value category behavior of the wrapped callable object. `not_fn` is new in C++17, and replaces the deprecated `std::not1`, `std::not2`, `std::unary_negate` and `std::binary_negate`.
1060+
The `not_fn` function template takes a callable object and returns a callable object. When the returned callable object is later invoked with some arguments, it passes them to the original callable object, and logically negates the result. It preserves the const qualification and value category behavior of the wrapped callable object. `not_fn` is new in C++17, and replaces the deprecated `std::not1`, `std::not2`, `std::unary_negate`, and `std::binary_negate`.
10581061

10591062
```cpp
10601063
template <class Callable>

0 commit comments

Comments
 (0)