summaryrefslogtreecommitdiff
path: root/absl/types
diff options
context:
space:
mode:
Diffstat (limited to 'absl/types')
-rw-r--r--absl/types/BUILD.bazel1
-rw-r--r--absl/types/CMakeLists.txt1
-rw-r--r--absl/types/compare.h24
3 files changed, 26 insertions, 0 deletions
diff --git a/absl/types/BUILD.bazel b/absl/types/BUILD.bazel
index 3d5cf012..31a5daa2 100644
--- a/absl/types/BUILD.bazel
+++ b/absl/types/BUILD.bazel
@@ -293,6 +293,7 @@ cc_library(
copts = ABSL_DEFAULT_COPTS,
linkopts = ABSL_DEFAULT_LINKOPTS,
deps = [
+ "//absl/base:config",
"//absl/base:core_headers",
"//absl/meta:type_traits",
],
diff --git a/absl/types/CMakeLists.txt b/absl/types/CMakeLists.txt
index 1adf3c72..024c2c39 100644
--- a/absl/types/CMakeLists.txt
+++ b/absl/types/CMakeLists.txt
@@ -284,6 +284,7 @@ absl_cc_library(
COPTS
${ABSL_DEFAULT_COPTS}
DEPS
+ absl::config
absl::core_headers
absl::type_traits
PUBLIC
diff --git a/absl/types/compare.h b/absl/types/compare.h
index ab0543c0..3cf4a917 100644
--- a/absl/types/compare.h
+++ b/absl/types/compare.h
@@ -30,6 +30,17 @@
#ifndef ABSL_TYPES_COMPARE_H_
#define ABSL_TYPES_COMPARE_H_
+#include "absl/base/config.h"
+
+#ifdef ABSL_USES_STD_ORDERING
+
+#include <compare> // IWYU pragma: export
+#include <type_traits>
+
+#include "absl/meta/type_traits.h"
+
+#else
+
#include <cstddef>
#include <cstdint>
#include <cstdlib>
@@ -39,8 +50,19 @@
#include "absl/base/macros.h"
#include "absl/meta/type_traits.h"
+#endif
+
namespace absl {
ABSL_NAMESPACE_BEGIN
+
+#ifdef ABSL_USES_STD_ORDERING
+
+using std::partial_ordering;
+using std::strong_ordering;
+using std::weak_ordering;
+
+#else
+
namespace compare_internal {
using value_type = int8_t;
@@ -419,6 +441,8 @@ ABSL_COMPARE_INLINE_INIT(strong_ordering, greater,
#undef ABSL_COMPARE_INLINE_SUBCLASS_DECL
#undef ABSL_COMPARE_INLINE_INIT
+#endif // ABSL_USES_STD_ORDERING
+
namespace compare_internal {
// We also provide these comparator adapter functions for internal absl use.