Fix an example in the callback documentation
Add return value to make the demo code more accurate Bug: 1151318 Change-Id: Ia300589a5d0a722c9e3d4bbe3231ea69793df24b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2752668 Reviewed-by: danakj <danakj@chromium.org> Commit-Queue: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/master@{#862243}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
53d97b83e4
commit
dd47202dba
@ -608,7 +608,10 @@ Sometimes you want to call a function that returns a value in a callback that
|
||||
doesn't expect a return value.
|
||||
|
||||
```cpp
|
||||
int DoSomething(int arg) { cout << arg << endl; }
|
||||
int DoSomething(int arg) {
|
||||
cout << arg << endl;
|
||||
return arg;
|
||||
}
|
||||
base::RepeatingCallback<void(int)> cb =
|
||||
base::BindRepeating(IgnoreResult(&DoSomething));
|
||||
```
|
||||
|
Reference in New Issue
Block a user