[libc++] Add the C++17 <memory_resource> header (mono-patch)
This patch is the rebase and squash of three earlier patches.
It supersedes all three of them.
- D47111: experimental monotonic_buffer_resource.
- D47358: experimental pool resources.
- D47360: Copy std::experimental::pmr to std::pmr.
The significant difference between this patch and the-sum-of-those-three
is that this patch does not add `std::experimental::pmr::monotonic_buffer_resource`
and so on. This patch simply adds the C++17 standard facilities, and
leaves the `std::experimental` namespace entirely alone.
Differential Revision: https://reviews.llvm.org/D89057
NOKEYCHECK=True
GitOrigin-RevId: 243da90ea5357c1ca324f714ea4813dc9029af27
diff --git a/include/regex b/include/regex
index e1799d9..d45f6c1 100644
--- a/include/regex
+++ b/include/regex
@@ -769,6 +769,7 @@
#include <__iterator/back_insert_iterator.h>
#include <__iterator/wrap_iter.h>
#include <__locale>
+#include <__memory_resource/polymorphic_allocator.h>
#include <__utility/move.h>
#include <__utility/pair.h>
#include <__utility/swap.h>
@@ -6837,6 +6838,20 @@
_LIBCPP_END_NAMESPACE_STD
+#if _LIBCPP_STD_VER > 14
+_LIBCPP_BEGIN_NAMESPACE_STD
+namespace pmr {
+template <class _BidirT>
+using match_results = std::match_results<_BidirT, polymorphic_allocator<std::sub_match<_BidirT>>>;
+
+using cmatch = match_results<const char*>;
+using wcmatch = match_results<const wchar_t*>;
+using smatch = match_results<std::pmr::string::const_iterator>;
+using wsmatch = match_results<std::pmr::wstring::const_iterator>;
+} // namespace pmr
+_LIBCPP_END_NAMESPACE_STD
+#endif
+
_LIBCPP_POP_MACROS
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20