mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
As string_view operations on std::map<std::string> won't be integrated until C++26, placeholder implementations are used which are less efficient in a couple of situations (e.g. insert with hint).
29 lines
1.0 KiB
Diff
29 lines
1.0 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: PJ Reiniger <pj.reiniger@gmail.com>
|
|
Date: Tue, 3 May 2022 22:16:10 -0400
|
|
Subject: [PATCH 12/38] Extra collections features
|
|
|
|
---
|
|
llvm/lib/Support/raw_ostream.cpp | 8 +++
|
|
2 files changed, 110 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
|
|
index 57d3091fd5cc5b416e814f9f33811f0fa7afe9cf..5bec803ccc76ce287b7ff3ea037d5e490a7af20c 100644
|
|
--- a/llvm/lib/Support/raw_ostream.cpp
|
|
+++ b/llvm/lib/Support/raw_ostream.cpp
|
|
@@ -77,6 +77,14 @@ constexpr raw_ostream::Colors raw_ostream::WHITE;
|
|
constexpr raw_ostream::Colors raw_ostream::SAVEDCOLOR;
|
|
constexpr raw_ostream::Colors raw_ostream::RESET;
|
|
|
|
+namespace {
|
|
+// Find the length of an array.
|
|
+template <class T, std::size_t N>
|
|
+constexpr inline size_t array_lengthof(T (&)[N]) {
|
|
+ return N;
|
|
+}
|
|
+} // namespace
|
|
+
|
|
raw_ostream::~raw_ostream() {
|
|
// raw_ostream's subclasses should take care to flush the buffer
|
|
// in their destructors.
|