diff options
Diffstat (limited to 'absl/container/internal')
-rw-r--r-- | absl/container/internal/layout.h | 4 | ||||
-rw-r--r-- | absl/container/internal/raw_hash_set.cc | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/absl/container/internal/layout.h b/absl/container/internal/layout.h index a9c1244a4e79..3d21ac963b45 100644 --- a/absl/container/internal/layout.h +++ b/absl/container/internal/layout.h @@ -253,8 +253,10 @@ template <class From, class To> using CopyConst = typename std::conditional<std::is_const<From>::value, const To, To>::type; +// Note: We're not qualifying this with absl:: because it doesn't compile under +// MSVC. template <class T> -using SliceType = absl::Span<T>; +using SliceType = Span<T>; // This namespace contains no types. It prevents functions defined in it from // being found by ADL. diff --git a/absl/container/internal/raw_hash_set.cc b/absl/container/internal/raw_hash_set.cc index 10153129fd1e..180d3fe5a91f 100644 --- a/absl/container/internal/raw_hash_set.cc +++ b/absl/container/internal/raw_hash_set.cc @@ -14,6 +14,7 @@ #include "absl/container/internal/raw_hash_set.h" +#include <atomic> #include <cstddef> #include "absl/base/config.h" @@ -29,7 +30,7 @@ inline size_t RandomSeed() { static thread_local size_t counter = 0; size_t value = ++counter; #else // ABSL_HAVE_THREAD_LOCAL - static std::atomic<size_t> counter; + static std::atomic<size_t> counter(0); size_t value = counter.fetch_add(1, std::memory_order_relaxed); #endif // ABSL_HAVE_THREAD_LOCAL return value ^ static_cast<size_t>(reinterpret_cast<uintptr_t>(&counter)); |