-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(util): Add
overloaded
helper (#3816)
This is useful in combination with `std::visit`. With this, you can do something like ```cpp struct A {}; std::variant<int, double, A> var; var = 42; std::visit(overloaded{ [](int) { BOOST_CHECK(true); }, [](double) { BOOST_CHECK(false); }, [](A) { BOOST_CHECK(false); }, }, var); ``` which can be convenient. I'm using this in #3869
- Loading branch information
1 parent
6e3a9a6
commit edad4c9
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters