// // Copyright 2024 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // hash_containers.h: angle::HashMap and HashSet #ifndef COMMON_HASH_CONTAINERS_H_ #define COMMON_HASH_CONTAINERS_H_ #if defined(ANGLE_USE_ABSEIL) # include "absl/container/flat_hash_map.h" # include "absl/container/flat_hash_set.h" #else # include # include #endif // defined(ANGLE_USE_ABSEIL) namespace angle { #if defined(ANGLE_USE_ABSEIL) template , class Eq = absl::container_internal::hash_default_eq> using HashMap = absl::flat_hash_map; template , class Eq = absl::container_internal::hash_default_eq> using HashSet = absl::flat_hash_set; // Absl has generic lookup unconditionally # define ANGLE_HAS_HASH_MAP_GENERIC_LOOKUP 1 #else template , class KeyEqual = std::equal_to> using HashMap = std::unordered_map; template , class KeyEqual = std::equal_to> using HashSet = std::unordered_set; # if __cpp_lib_generic_unordered_lookup >= 201811L # define ANGLE_HAS_HASH_MAP_GENERIC_LOOKUP 1 # else # define ANGLE_HAS_HASH_MAP_GENERIC_LOOKUP 0 # endif #endif // defined(ANGLE_USE_ABSEIL) } // namespace angle #endif // COMMON_HASH_CONTAINERS_H_