From 37ebde53cfcf400ef01b59c80ae3f72039cd90f2 Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Mon, 1 Jul 2024 11:33:54 -0700 Subject: Make c_begin, c_end, and c_distance conditionally constexpr. This allows them to be used in constexpr expressions, such as the following: ``` constexpr int distance = absl::c_distance(std::array()); ``` Requires at least C++17 to be constexpr. PiperOrigin-RevId: 648435141 Change-Id: I8136e351a6dc4c25f06ef895fb449f4f11048480 --- absl/algorithm/BUILD.bazel | 2 ++ 1 file changed, 2 insertions(+) (limited to 'absl/algorithm/BUILD.bazel') diff --git a/absl/algorithm/BUILD.bazel b/absl/algorithm/BUILD.bazel index ddf9e11f..f20e7290 100644 --- a/absl/algorithm/BUILD.bazel +++ b/absl/algorithm/BUILD.bazel @@ -65,6 +65,7 @@ cc_library( linkopts = ABSL_DEFAULT_LINKOPTS, deps = [ ":algorithm", + "//absl/base:config", "//absl/base:core_headers", "//absl/base:nullability", "//absl/meta:type_traits", @@ -79,6 +80,7 @@ cc_test( deps = [ ":container", "//absl/base", + "//absl/base:config", "//absl/base:core_headers", "//absl/memory", "//absl/types:span", -- cgit v1.2.3