diff options
Diffstat (limited to 'absl/types')
-rw-r--r-- | absl/types/CMakeLists.txt | 4 | ||||
-rw-r--r-- | absl/types/variant.h | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/absl/types/CMakeLists.txt b/absl/types/CMakeLists.txt index bc6c39e9cc99..e86207668539 100644 --- a/absl/types/CMakeLists.txt +++ b/absl/types/CMakeLists.txt @@ -123,7 +123,7 @@ absl_library( # test any_test set(ANY_TEST_SRC "any_test.cc") -set(ANY_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate absl::any absl::bad_any_cast test_instance_tracker_lib) +set(ANY_TEST_PUBLIC_LIBRARIES absl::base absl_internal_throw_delegate absl::any absl::bad_any_cast absl::test_instance_tracker) absl_test( TARGET @@ -169,7 +169,7 @@ absl_test( # test span_test set(SPAN_TEST_SRC "span_test.cc") -set(SPAN_TEST_PUBLIC_LIBRARIES absl::base absl::strings absl_internal_throw_delegate absl::span test_instance_tracker_lib) +set(SPAN_TEST_PUBLIC_LIBRARIES absl::base absl::strings absl_internal_throw_delegate absl::span absl::test_instance_tracker) absl_test( TARGET diff --git a/absl/types/variant.h b/absl/types/variant.h index 2f78722f8b7c..28aaef4feb6e 100644 --- a/absl/types/variant.h +++ b/absl/types/variant.h @@ -399,9 +399,9 @@ constexpr absl::add_pointer_t<const T> get_if( // Calls a provided functor on a given set of variants. `absl::visit()` is // commonly used to conditionally inspect the state of a given variant (or set // of variants). -// Requires: The expression in the Effects: element shall be a valid expression -// of the same type and value category, for all combinations of alternative -// types of all variants. Otherwise, the program is ill-formed. +// +// The functor must return the same type when called with any of the variants' +// alternatives. // // Example: // @@ -414,6 +414,7 @@ constexpr absl::add_pointer_t<const T> get_if( // }; // // // Declare our variant, and call `absl::visit()` on it. +// // Note that `GetVariant()` returns void in either case. // absl::variant<int, std::string> foo = std::string("foo"); // GetVariant visitor; // absl::visit(visitor, foo); // Prints `The variant's value is: foo' |