aboutsummaryrefslogtreecommitdiffhomepage
path: root/absl/types
diff options
context:
space:
mode:
Diffstat (limited to 'absl/types')
-rw-r--r--absl/types/any.h6
-rw-r--r--absl/types/any_exception_safety_test.cc4
-rw-r--r--absl/types/any_test.cc10
-rw-r--r--absl/types/bad_any_cast.cc4
-rw-r--r--absl/types/bad_any_cast.h6
-rw-r--r--absl/types/bad_optional_access.cc4
-rw-r--r--absl/types/bad_optional_access.h6
-rw-r--r--absl/types/bad_variant_access.cc4
-rw-r--r--absl/types/bad_variant_access.h6
-rw-r--r--absl/types/internal/variant.h4
-rw-r--r--absl/types/optional.h6
-rw-r--r--absl/types/optional_exception_safety_test.cc4
-rw-r--r--absl/types/optional_test.cc20
-rw-r--r--absl/types/variant.h6
-rw-r--r--absl/types/variant_exception_safety_test.cc16
-rw-r--r--absl/types/variant_test.cc34
16 files changed, 70 insertions, 70 deletions
diff --git a/absl/types/any.h b/absl/types/any.h
index 507c8b2..f796769 100644
--- a/absl/types/any.h
+++ b/absl/types/any.h
@@ -56,7 +56,7 @@
#include "absl/base/config.h"
#include "absl/utility/utility.h"
-#ifdef ABSL_HAVE_STD_ANY
+#ifdef ABSL_USES_STD_ANY
#include <any> // IWYU pragma: export
@@ -67,7 +67,7 @@ using std::bad_any_cast;
using std::make_any;
} // namespace absl
-#else // ABSL_HAVE_STD_ANY
+#else // ABSL_USES_STD_ANY
#include <algorithm>
#include <cstddef>
@@ -538,6 +538,6 @@ T* any_cast(any* operand) noexcept {
#undef ABSL_ANY_DETAIL_HAS_RTTI
-#endif // ABSL_HAVE_STD_ANY
+#endif // ABSL_USES_STD_ANY
#endif // ABSL_TYPES_ANY_H_
diff --git a/absl/types/any_exception_safety_test.cc b/absl/types/any_exception_safety_test.cc
index 17d7f5d..31c1140 100644
--- a/absl/types/any_exception_safety_test.cc
+++ b/absl/types/any_exception_safety_test.cc
@@ -18,7 +18,7 @@
// This test is a no-op when absl::any is an alias for std::any and when
// exceptions are not enabled.
-#if !defined(ABSL_HAVE_STD_ANY) && defined(ABSL_HAVE_EXCEPTIONS)
+#if !defined(ABSL_USES_STD_ANY) && defined(ABSL_HAVE_EXCEPTIONS)
#include <typeinfo>
#include <vector>
@@ -170,4 +170,4 @@ TEST(AnyExceptionSafety, Emplace) {
} // namespace
-#endif // #if !defined(ABSL_HAVE_STD_ANY) && defined(ABSL_HAVE_EXCEPTIONS)
+#endif // #if !defined(ABSL_USES_STD_ANY) && defined(ABSL_HAVE_EXCEPTIONS)
diff --git a/absl/types/any_test.cc b/absl/types/any_test.cc
index 4a848ae..70e4ba2 100644
--- a/absl/types/any_test.cc
+++ b/absl/types/any_test.cc
@@ -15,7 +15,7 @@
#include "absl/types/any.h"
// This test is a no-op when absl::any is an alias for std::any.
-#if !defined(ABSL_HAVE_STD_ANY)
+#if !defined(ABSL_USES_STD_ANY)
#include <initializer_list>
#include <type_traits>
@@ -642,7 +642,7 @@ TEST(AnyTest, ConversionConstructionCausesOneCopy) {
// Tests for Exception Behavior //
//////////////////////////////////
-#if defined(ABSL_HAVE_STD_ANY)
+#if defined(ABSL_USES_STD_ANY)
// If using a std `any` implementation, we can't check for a specific message.
#define ABSL_ANY_TEST_EXPECT_BAD_ANY_CAST(...) \
@@ -656,7 +656,7 @@ TEST(AnyTest, ConversionConstructionCausesOneCopy) {
ABSL_BASE_INTERNAL_EXPECT_FAIL((__VA_ARGS__), absl::bad_any_cast, \
"Bad any cast")
-#endif // defined(ABSL_HAVE_STD_ANY)
+#endif // defined(ABSL_USES_STD_ANY)
TEST(AnyTest, ThrowBadAlloc) {
{
@@ -764,7 +764,7 @@ TEST(AnyTest, FailedEmplace) {
BadCopyable bad;
absl::any target(absl::in_place_type<int>);
ABSL_ANY_TEST_EXPECT_BAD_COPY(target.emplace<BadCopyable>(bad));
-#if defined(ABSL_HAVE_STD_ANY) && defined(__GLIBCXX__)
+#if defined(ABSL_USES_STD_ANY) && defined(__GLIBCXX__)
// libstdc++ std::any::emplace() implementation (as of 7.2) has a bug: if an
// exception is thrown, *this contains a value.
#define ABSL_GLIBCXX_ANY_EMPLACE_EXCEPTION_BUG 1
@@ -778,4 +778,4 @@ TEST(AnyTest, FailedEmplace) {
} // namespace
-#endif // #if !defined(ABSL_HAVE_STD_ANY)
+#endif // #if !defined(ABSL_USES_STD_ANY)
diff --git a/absl/types/bad_any_cast.cc b/absl/types/bad_any_cast.cc
index 505919a..2a53812 100644
--- a/absl/types/bad_any_cast.cc
+++ b/absl/types/bad_any_cast.cc
@@ -14,7 +14,7 @@
#include "absl/types/bad_any_cast.h"
-#ifndef ABSL_HAVE_STD_ANY
+#ifndef ABSL_USES_STD_ANY
#include <cstdlib>
@@ -41,4 +41,4 @@ void ThrowBadAnyCast() {
} // namespace any_internal
} // namespace absl
-#endif // ABSL_HAVE_STD_ANY
+#endif // ABSL_USES_STD_ANY
diff --git a/absl/types/bad_any_cast.h b/absl/types/bad_any_cast.h
index 8d020ed..6a53c01 100644
--- a/absl/types/bad_any_cast.h
+++ b/absl/types/bad_any_cast.h
@@ -25,7 +25,7 @@
#include "absl/base/config.h"
-#ifdef ABSL_HAVE_STD_ANY
+#ifdef ABSL_USES_STD_ANY
#include <any>
@@ -33,7 +33,7 @@ namespace absl {
using std::bad_any_cast;
} // namespace absl
-#else // ABSL_HAVE_STD_ANY
+#else // ABSL_USES_STD_ANY
namespace absl {
@@ -66,6 +66,6 @@ namespace any_internal {
} // namespace any_internal
} // namespace absl
-#endif // ABSL_HAVE_STD_ANY
+#endif // ABSL_USES_STD_ANY
#endif // ABSL_TYPES_BAD_ANY_CAST_H_
diff --git a/absl/types/bad_optional_access.cc b/absl/types/bad_optional_access.cc
index a791c7c..d9ec21b 100644
--- a/absl/types/bad_optional_access.cc
+++ b/absl/types/bad_optional_access.cc
@@ -14,7 +14,7 @@
#include "absl/types/bad_optional_access.h"
-#ifndef ABSL_HAVE_STD_OPTIONAL
+#ifndef ABSL_USES_STD_OPTIONAL
#include <cstdlib>
@@ -43,4 +43,4 @@ void throw_bad_optional_access() {
} // namespace optional_internal
} // namespace absl
-#endif // ABSL_HAVE_STD_OPTIONAL
+#endif // ABSL_USES_STD_OPTIONAL
diff --git a/absl/types/bad_optional_access.h b/absl/types/bad_optional_access.h
index add5c45..32dd6a9 100644
--- a/absl/types/bad_optional_access.h
+++ b/absl/types/bad_optional_access.h
@@ -25,7 +25,7 @@
#include "absl/base/config.h"
-#ifdef ABSL_HAVE_STD_OPTIONAL
+#ifdef ABSL_USES_STD_OPTIONAL
#include <optional>
@@ -33,7 +33,7 @@ namespace absl {
using std::bad_optional_access;
} // namespace absl
-#else // ABSL_HAVE_STD_OPTIONAL
+#else // ABSL_USES_STD_OPTIONAL
namespace absl {
@@ -69,6 +69,6 @@ namespace optional_internal {
} // namespace optional_internal
} // namespace absl
-#endif // ABSL_HAVE_STD_OPTIONAL
+#endif // ABSL_USES_STD_OPTIONAL
#endif // ABSL_TYPES_BAD_OPTIONAL_ACCESS_H_
diff --git a/absl/types/bad_variant_access.cc b/absl/types/bad_variant_access.cc
index a4325c8..dbaea9e 100644
--- a/absl/types/bad_variant_access.cc
+++ b/absl/types/bad_variant_access.cc
@@ -14,7 +14,7 @@
#include "absl/types/bad_variant_access.h"
-#ifndef ABSL_HAVE_STD_VARIANT
+#ifndef ABSL_USES_STD_VARIANT
#include <cstdlib>
#include <stdexcept>
@@ -59,4 +59,4 @@ void Rethrow() {
} // namespace variant_internal
} // namespace absl
-#endif // ABSL_HAVE_STD_VARIANT
+#endif // ABSL_USES_STD_VARIANT
diff --git a/absl/types/bad_variant_access.h b/absl/types/bad_variant_access.h
index 637db43..6935d01 100644
--- a/absl/types/bad_variant_access.h
+++ b/absl/types/bad_variant_access.h
@@ -25,7 +25,7 @@
#include "absl/base/config.h"
-#ifdef ABSL_HAVE_STD_VARIANT
+#ifdef ABSL_USES_STD_VARIANT
#include <variant>
@@ -33,7 +33,7 @@ namespace absl {
using std::bad_variant_access;
} // namespace absl
-#else // ABSL_HAVE_STD_VARIANT
+#else // ABSL_USES_STD_VARIANT
namespace absl {
@@ -73,6 +73,6 @@ namespace variant_internal {
} // namespace variant_internal
} // namespace absl
-#endif // ABSL_HAVE_STD_VARIANT
+#endif // ABSL_USES_STD_VARIANT
#endif // ABSL_TYPES_BAD_VARIANT_ACCESS_H_
diff --git a/absl/types/internal/variant.h b/absl/types/internal/variant.h
index 19de2e1..58b3859 100644
--- a/absl/types/internal/variant.h
+++ b/absl/types/internal/variant.h
@@ -37,7 +37,7 @@
#include "absl/types/bad_variant_access.h"
#include "absl/utility/utility.h"
-#if !defined(ABSL_HAVE_STD_VARIANT)
+#if !defined(ABSL_USES_STD_VARIANT)
namespace absl {
@@ -1640,5 +1640,5 @@ struct VariantHashBase<Variant,
} // namespace variant_internal
} // namespace absl
-#endif // !defined(ABSL_HAVE_STD_VARIANT)
+#endif // !defined(ABSL_USES_STD_VARIANT)
#endif // ABSL_TYPES_variant_internal_H_
diff --git a/absl/types/optional.h b/absl/types/optional.h
index ed8faf9..1403259 100644
--- a/absl/types/optional.h
+++ b/absl/types/optional.h
@@ -38,7 +38,7 @@
#include "absl/base/config.h" // TODO(calabrese) IWYU removal?
#include "absl/utility/utility.h"
-#ifdef ABSL_HAVE_STD_OPTIONAL
+#ifdef ABSL_USES_STD_OPTIONAL
#include <optional> // IWYU pragma: export
@@ -50,7 +50,7 @@ using std::nullopt_t;
using std::nullopt;
} // namespace absl
-#else // ABSL_HAVE_STD_OPTIONAL
+#else // ABSL_USES_STD_OPTIONAL
#include <cassert>
#include <functional>
@@ -767,6 +767,6 @@ struct hash<absl::optional<T> >
#undef ABSL_MSVC_CONSTEXPR_BUG_IN_UNION_LIKE_CLASS
-#endif // ABSL_HAVE_STD_OPTIONAL
+#endif // ABSL_USES_STD_OPTIONAL
#endif // ABSL_TYPES_OPTIONAL_H_
diff --git a/absl/types/optional_exception_safety_test.cc b/absl/types/optional_exception_safety_test.cc
index f99e35c..0f7fae6 100644
--- a/absl/types/optional_exception_safety_test.cc
+++ b/absl/types/optional_exception_safety_test.cc
@@ -18,7 +18,7 @@
// This test is a no-op when absl::optional is an alias for std::optional and
// when exceptions are not enabled.
-#if !defined(ABSL_HAVE_STD_OPTIONAL) && defined(ABSL_HAVE_EXCEPTIONS)
+#if !defined(ABSL_USES_STD_OPTIONAL) && defined(ABSL_HAVE_EXCEPTIONS)
#include "gtest/gtest.h"
#include "absl/base/internal/exception_safety_testing.h"
@@ -287,4 +287,4 @@ TEST(OptionalExceptionSafety, NothrowMoveAssign) {
} // namespace absl
-#endif // #if !defined(ABSL_HAVE_STD_OPTIONAL) && defined(ABSL_HAVE_EXCEPTIONS)
+#endif // #if !defined(ABSL_USES_STD_OPTIONAL) && defined(ABSL_HAVE_EXCEPTIONS)
diff --git a/absl/types/optional_test.cc b/absl/types/optional_test.cc
index 35efa86..47d5c8a 100644
--- a/absl/types/optional_test.cc
+++ b/absl/types/optional_test.cc
@@ -15,7 +15,7 @@
#include "absl/types/optional.h"
// This test is a no-op when absl::optional is an alias for std::optional.
-#if !defined(ABSL_HAVE_STD_OPTIONAL)
+#if !defined(ABSL_USES_STD_OPTIONAL)
#include <string>
#include <type_traits>
@@ -224,7 +224,7 @@ TEST(optionalTest, CopyConstructor) {
EXPECT_FALSE(
absl::is_trivially_copy_constructible<absl::optional<Copyable>>::value);
-#if defined(ABSL_HAVE_STD_OPTIONAL) && defined(__GLIBCXX__)
+#if defined(ABSL_USES_STD_OPTIONAL) && defined(__GLIBCXX__)
// libstdc++ std::optional implementation (as of 7.2) has a bug: when T is
// trivially copyable, optional<T> is not trivially copyable (due to one of
// its base class is unconditionally nontrivial).
@@ -279,7 +279,7 @@ TEST(optionalTest, CopyConstructor) {
// std::optional when T is volatile-qualified. So skipping this test.
// Bug report:
// https://connect.microsoft.com/VisualStudio/feedback/details/3142534
-#if defined(ABSL_HAVE_STD_OPTIONAL) && defined(_MSC_VER) && _MSC_VER >= 1911
+#if defined(ABSL_USES_STD_OPTIONAL) && defined(_MSC_VER) && _MSC_VER >= 1911
#define ABSL_MSVC_OPTIONAL_VOLATILE_COPY_BUG 1
#endif
#ifndef ABSL_MSVC_OPTIONAL_VOLATILE_COPY_BUG
@@ -305,7 +305,7 @@ TEST(optionalTest, MoveConstructor) {
EXPECT_FALSE(std::is_move_constructible<absl::optional<NonMovable>>::value);
// test noexcept
EXPECT_TRUE(std::is_nothrow_move_constructible<absl::optional<int>>::value);
-#ifndef ABSL_HAVE_STD_OPTIONAL
+#ifndef ABSL_USES_STD_OPTIONAL
EXPECT_EQ(
absl::default_allocator_is_nothrow::value,
std::is_nothrow_move_constructible<absl::optional<MoveableThrow>>::value);
@@ -639,7 +639,7 @@ TEST(optionalTest, CopyAssignment) {
EXPECT_FALSE(absl::is_trivially_copy_assignable<NonTrivial>::value);
// std::optional doesn't support volatile nontrivial types.
-#ifndef ABSL_HAVE_STD_OPTIONAL
+#ifndef ABSL_USES_STD_OPTIONAL
{
StructorListener listener;
Listenable::listener = &listener;
@@ -658,7 +658,7 @@ TEST(optionalTest, CopyAssignment) {
EXPECT_EQ(1, listener.destruct);
EXPECT_EQ(1, listener.volatile_copy_assign);
}
-#endif // ABSL_HAVE_STD_OPTIONAL
+#endif // ABSL_USES_STD_OPTIONAL
}
TEST(optionalTest, MoveAssignment) {
@@ -682,7 +682,7 @@ TEST(optionalTest, MoveAssignment) {
EXPECT_EQ(1, listener.move_assign);
}
// std::optional doesn't support volatile nontrivial types.
-#ifndef ABSL_HAVE_STD_OPTIONAL
+#ifndef ABSL_USES_STD_OPTIONAL
{
StructorListener listener;
Listenable::listener = &listener;
@@ -702,7 +702,7 @@ TEST(optionalTest, MoveAssignment) {
EXPECT_EQ(1, listener.destruct);
EXPECT_EQ(1, listener.volatile_move_assign);
}
-#endif // ABSL_HAVE_STD_OPTIONAL
+#endif // ABSL_USES_STD_OPTIONAL
EXPECT_FALSE(absl::is_move_assignable<absl::optional<const int>>::value);
EXPECT_TRUE(absl::is_move_assignable<absl::optional<Copyable>>::value);
EXPECT_TRUE(absl::is_move_assignable<absl::optional<MoveableThrow>>::value);
@@ -1560,7 +1560,7 @@ TEST(optionalTest, NoExcept) {
static_assert(
std::is_nothrow_move_constructible<absl::optional<MoveMeNoThrow>>::value,
"");
-#ifndef ABSL_HAVE_STD_OPTIONAL
+#ifndef ABSL_USES_STD_OPTIONAL
static_assert(absl::default_allocator_is_nothrow::value ==
std::is_nothrow_move_constructible<
absl::optional<MoveMeThrow>>::value,
@@ -1658,4 +1658,4 @@ TEST(optionalTest, InPlaceTSFINAEBug) {
} // namespace
-#endif // #if !defined(ABSL_HAVE_STD_OPTIONAL)
+#endif // #if !defined(ABSL_USES_STD_OPTIONAL)
diff --git a/absl/types/variant.h b/absl/types/variant.h
index 7ef7f88..f355870 100644
--- a/absl/types/variant.h
+++ b/absl/types/variant.h
@@ -45,7 +45,7 @@
#include "absl/base/config.h"
#include "absl/utility/utility.h"
-#ifdef ABSL_HAVE_STD_VARIANT
+#ifdef ABSL_USES_STD_VARIANT
#include <variant> // IWYU pragma: export
@@ -64,7 +64,7 @@ using std::variant_size_v;
using std::visit;
} // namespace absl
-#else // ABSL_HAVE_STD_VARIANT
+#else // ABSL_USES_STD_VARIANT
#include <functional>
#include <new>
@@ -812,7 +812,7 @@ struct hash<absl::variant<T...>>
} // namespace std
-#endif // ABSL_HAVE_STD_VARIANT
+#endif // ABSL_USES_STD_VARIANT
namespace absl {
namespace variant_internal {
diff --git a/absl/types/variant_exception_safety_test.cc b/absl/types/variant_exception_safety_test.cc
index fd7e6c7..b486a71 100644
--- a/absl/types/variant_exception_safety_test.cc
+++ b/absl/types/variant_exception_safety_test.cc
@@ -18,7 +18,7 @@
// This test is a no-op when absl::variant is an alias for std::variant and when
// exceptions are not enabled.
-#if !defined(ABSL_HAVE_STD_VARIANT) && defined(ABSL_HAVE_EXCEPTIONS)
+#if !defined(ABSL_USES_STD_VARIANT) && defined(ABSL_HAVE_EXCEPTIONS)
#include <iostream>
#include <memory>
@@ -237,7 +237,7 @@ TEST(VariantExceptionSafetyTest, CopyAssign) {
}
// libstdc++ std::variant has bugs on copy assignment regarding exception
// safety.
-#if !(defined(ABSL_HAVE_STD_VARIANT) && defined(__GLIBCXX__))
+#if !(defined(ABSL_USES_STD_VARIANT) && defined(__GLIBCXX__))
// index() != j
// if is_nothrow_copy_constructible_v<Tj> or
// !is_nothrow_move_constructible<Tj> is true, equivalent to
@@ -268,7 +268,7 @@ TEST(VariantExceptionSafetyTest, CopyAssign) {
.Test());
EXPECT_FALSE(tester.WithContracts(strong_guarantee).Test());
}
-#endif // !(defined(ABSL_HAVE_STD_VARIANT) && defined(__GLIBCXX__))
+#endif // !(defined(ABSL_USES_STD_VARIANT) && defined(__GLIBCXX__))
{
// is_nothrow_copy_constructible_v<Tj> == false &&
// is_nothrow_move_constructible_v<Tj> == true
@@ -325,7 +325,7 @@ TEST(VariantExceptionSafetyTest, MoveAssign) {
// The fix is targeted for gcc-9.
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87431#c7
// https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=267614
-#if !(defined(ABSL_HAVE_STD_VARIANT) && \
+#if !(defined(ABSL_USES_STD_VARIANT) && \
defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE == 8)
// - otherwise (index() != j), equivalent to
// emplace<j>(get<j>(std::move(rhs)))
@@ -342,7 +342,7 @@ TEST(VariantExceptionSafetyTest, MoveAssign) {
auto copy = rhs;
*lhs = std::move(copy);
}));
-#endif // !(defined(ABSL_HAVE_STD_VARIANT) &&
+#endif // !(defined(ABSL_USES_STD_VARIANT) &&
// defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE == 8)
}
}
@@ -445,7 +445,7 @@ TEST(VariantExceptionSafetyTest, ValueAssign) {
// and operator=(variant&&) invokes Tj's move ctor which doesn't throw.
// libstdc++ std::variant has bugs on conversion assignment regarding
// exception safety.
-#if !(defined(ABSL_HAVE_STD_VARIANT) && defined(__GLIBCXX__))
+#if !(defined(ABSL_USES_STD_VARIANT) && defined(__GLIBCXX__))
{
MoveNothrow rhs;
EXPECT_TRUE(MakeExceptionSafetyTester()
@@ -453,7 +453,7 @@ TEST(VariantExceptionSafetyTest, ValueAssign) {
.WithContracts(VariantInvariants, strong_guarantee)
.Test([&rhs](ThrowingVariant* lhs) { *lhs = rhs; }));
}
-#endif // !(defined(ABSL_HAVE_STD_VARIANT) && defined(__GLIBCXX__))
+#endif // !(defined(ABSL_USES_STD_VARIANT) && defined(__GLIBCXX__))
}
TEST(VariantExceptionSafetyTest, Emplace) {
@@ -527,4 +527,4 @@ TEST(VariantExceptionSafetyTest, Swap) {
#endif // !defined(ABSL_INTERNAL_MSVC_2017_DBG_MODE)
-#endif // #if !defined(ABSL_HAVE_STD_VARIANT) && defined(ABSL_HAVE_EXCEPTIONS)
+#endif // #if !defined(ABSL_USES_STD_VARIANT) && defined(ABSL_HAVE_EXCEPTIONS)
diff --git a/absl/types/variant_test.cc b/absl/types/variant_test.cc
index b591274..2913775 100644
--- a/absl/types/variant_test.cc
+++ b/absl/types/variant_test.cc
@@ -20,7 +20,7 @@
#include "absl/types/variant.h"
// This test is a no-op when absl::variant is an alias for std::variant.
-#if !defined(ABSL_HAVE_STD_VARIANT)
+#if !defined(ABSL_USES_STD_VARIANT)
#include <algorithm>
#include <cstddef>
@@ -842,7 +842,7 @@ TEST(VariantTest, TestBackupAssign) {
}
// libstdc++ doesn't pass this test
-#if !(defined(ABSL_HAVE_STD_VARIANT) && defined(__GLIBCXX__))
+#if !(defined(ABSL_USES_STD_VARIANT) && defined(__GLIBCXX__))
EXPECT_EQ(3, counter[0]);
EXPECT_EQ(2, counter[1]);
EXPECT_EQ(2, counter[2]);
@@ -1933,7 +1933,7 @@ TEST(VariantTest, VisitReferenceWrapper) {
}
// libstdc++ std::variant doesn't support the INVOKE semantics.
-#if !(defined(ABSL_HAVE_STD_VARIANT) && defined(__GLIBCXX__))
+#if !(defined(ABSL_USES_STD_VARIANT) && defined(__GLIBCXX__))
TEST(VariantTest, VisitMemberFunction) {
absl::variant<std::unique_ptr<Class>> p(absl::make_unique<Class>());
absl::variant<std::unique_ptr<const Class>> cp(
@@ -1957,7 +1957,7 @@ TEST(VariantTest, VisitDataMember) {
EXPECT_EQ(42, absl::visit(&Class::member, cp));
}
-#endif // !(defined(ABSL_HAVE_STD_VARIANT) && defined(__GLIBCXX__))
+#endif // !(defined(ABSL_USES_STD_VARIANT) && defined(__GLIBCXX__))
/////////////////////////
// [variant.monostate] //
@@ -2035,7 +2035,7 @@ TEST(VariantTest, NonmemberSwap) {
std::swap(a, b);
EXPECT_THAT(a, VariantWith<SpecialSwap>(v2));
EXPECT_THAT(b, VariantWith<SpecialSwap>(v1));
-#ifndef ABSL_HAVE_STD_VARIANT
+#ifndef ABSL_USES_STD_VARIANT
EXPECT_FALSE(absl::get<SpecialSwap>(a).special_swap);
#endif
@@ -2083,7 +2083,7 @@ TEST(VariantTest, Hash) {
// MSVC std::hash<std::variant> does not use the index, thus produce the same
// result on the same value as different alternative.
-#if !(defined(_MSC_VER) && defined(ABSL_HAVE_STD_VARIANT))
+#if !(defined(_MSC_VER) && defined(ABSL_USES_STD_VARIANT))
{
// same value as different alternative
variant<int, int> v0(in_place_index<0>, 42);
@@ -2091,7 +2091,7 @@ TEST(VariantTest, Hash) {
std::hash<variant<int, int>> hash;
EXPECT_NE(hash(v0), hash(v1));
}
-#endif // !(defined(_MSC_VER) && defined(ABSL_HAVE_STD_VARIANT))
+#endif // !(defined(_MSC_VER) && defined(ABSL_USES_STD_VARIANT))
{
std::hash<variant<int>> hash;
@@ -2118,7 +2118,7 @@ TEST(VariantTest, Hash) {
////////////////////////////////////////
// Test that a set requiring a basic type conversion works correctly
-#if !defined(ABSL_HAVE_STD_VARIANT)
+#if !defined(ABSL_USES_STD_VARIANT)
TEST(VariantTest, TestConvertingSet) {
typedef variant<double> Variant;
Variant v(1.0);
@@ -2128,7 +2128,7 @@ TEST(VariantTest, TestConvertingSet) {
ASSERT_TRUE(nullptr != absl::get_if<double>(&v));
EXPECT_DOUBLE_EQ(2, absl::get<double>(v));
}
-#endif // ABSL_HAVE_STD_VARIANT
+#endif // ABSL_USES_STD_VARIANT
// Test that a vector of variants behaves reasonably.
TEST(VariantTest, Container) {
@@ -2280,7 +2280,7 @@ struct Convertible2 {
};
TEST(VariantTest, TestRvalueConversion) {
-#if !defined(ABSL_HAVE_STD_VARIANT)
+#if !defined(ABSL_USES_STD_VARIANT)
variant<double, std::string> var(
ConvertVariantTo<variant<double, std::string>>(
variant<std::string, int>(0)));
@@ -2313,7 +2313,7 @@ TEST(VariantTest, TestRvalueConversion) {
variant2 = ConvertVariantTo<variant<int32_t, uint32_t>>(variant<uint32_t>(42));
ASSERT_TRUE(absl::holds_alternative<uint32_t>(variant2));
EXPECT_EQ(42, absl::get<uint32_t>(variant2));
-#endif // !ABSL_HAVE_STD_VARIANT
+#endif // !ABSL_USES_STD_VARIANT
variant<Convertible1, Convertible2> variant3(
ConvertVariantTo<variant<Convertible1, Convertible2>>(
@@ -2326,7 +2326,7 @@ TEST(VariantTest, TestRvalueConversion) {
}
TEST(VariantTest, TestLvalueConversion) {
-#if !defined(ABSL_HAVE_STD_VARIANT)
+#if !defined(ABSL_USES_STD_VARIANT)
variant<std::string, int> source1 = 0;
variant<double, std::string> destination(
ConvertVariantTo<variant<double, std::string>>(source1));
@@ -2428,7 +2428,7 @@ TEST(VariantTest, DoesNotMoveFromLvalues) {
}
TEST(VariantTest, TestRvalueConversionViaConvertVariantTo) {
-#if !defined(ABSL_HAVE_STD_VARIANT)
+#if !defined(ABSL_USES_STD_VARIANT)
variant<double, std::string> var(
ConvertVariantTo<variant<double, std::string>>(
variant<std::string, int>(3)));
@@ -2467,7 +2467,7 @@ TEST(VariantTest, TestRvalueConversionViaConvertVariantTo) {
}
TEST(VariantTest, TestLvalueConversionViaConvertVariantTo) {
-#if !defined(ABSL_HAVE_STD_VARIANT)
+#if !defined(ABSL_USES_STD_VARIANT)
variant<std::string, int> source1 = 3;
variant<double, std::string> destination(
ConvertVariantTo<variant<double, std::string>>(source1));
@@ -2499,7 +2499,7 @@ TEST(VariantTest, TestLvalueConversionViaConvertVariantTo) {
variant<uint32_t> source6(42);
variant2 = ConvertVariantTo<variant<int32_t, uint32_t>>(source6);
EXPECT_THAT(absl::get_if<uint32_t>(&variant2), Pointee(42));
-#endif // !ABSL_HAVE_STD_VARIANT
+#endif // !ABSL_USES_STD_VARIANT
variant<Convertible2, Convertible1> source7((Convertible1()));
variant<Convertible1, Convertible2> variant3(
@@ -2533,7 +2533,7 @@ TEST(VariantTest, TestMoveConversionViaConvertVariantTo) {
// standard and we know that libstdc++ variant doesn't have this feature.
// For more details see the paper:
// http://open-std.org/JTC1/SC22/WG21/docs/papers/2017/p0602r0.html
-#if !(defined(ABSL_HAVE_STD_VARIANT) && defined(__GLIBCXX__))
+#if !(defined(ABSL_USES_STD_VARIANT) && defined(__GLIBCXX__))
#define ABSL_VARIANT_PROPAGATE_COPY_MOVE_TRIVIALITY 1
#endif
@@ -2711,4 +2711,4 @@ TEST(VariantTest, MoveCtorBug) {
} // namespace
} // namespace absl
-#endif // #if !defined(ABSL_HAVE_STD_VARIANT)
+#endif // #if !defined(ABSL_USES_STD_VARIANT)