diff options
Diffstat (limited to 'absl/container/internal/hash_generator_testing.h')
-rw-r--r-- | absl/container/internal/hash_generator_testing.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/absl/container/internal/hash_generator_testing.h b/absl/container/internal/hash_generator_testing.h index 27fb84f5d0f6..477215cdba23 100644 --- a/absl/container/internal/hash_generator_testing.h +++ b/absl/container/internal/hash_generator_testing.h @@ -19,6 +19,7 @@ #define ABSL_CONTAINER_INTERNAL_HASH_GENERATOR_TESTING_H_ #include <stdint.h> + #include <algorithm> #include <iosfwd> #include <random> @@ -27,6 +28,7 @@ #include <utility> #include "absl/container/internal/hash_policy_testing.h" +#include "absl/memory/memory.h" #include "absl/meta/type_traits.h" #include "absl/strings/string_view.h" @@ -129,6 +131,13 @@ struct Generator<std::tuple<Ts...>> { } }; +template <class T> +struct Generator<std::unique_ptr<T>> { + std::unique_ptr<T> operator()() const { + return absl::make_unique<T>(Generator<T>()()); + } +}; + template <class U> struct Generator<U, absl::void_t<decltype(std::declval<U&>().key()), decltype(std::declval<U&>().value())>> |