From 20aa1aee7e34c49839b58560f338efbd557c9f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Thu, 22 Jan 2026 00:09:11 +0100 Subject: [PATCH] Implement "ends_with" and update "starts_with" to the same implementation style. --- doc/container.qbk | 2 +- include/boost/container/string.hpp | 46 ++++++++++++++++++++++++++++-- test/string_test.cpp | 32 ++++++--------------- 3 files changed, 52 insertions(+), 28 deletions(-) diff --git a/doc/container.qbk b/doc/container.qbk index f1664ee..336b6b9 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -1461,7 +1461,7 @@ use [*Boost.Container]? There are several reasons for that: * Implemented overaligned allocation support for `adaptive_pool`and `node_allocator` * Updated `basic_string` to the latest standard API: * Added missing `string_view` members and updated `operator[]` to be able to return the terminating null. - * Added C++20 `starts_with` and C++23 `contains` overloads. + * Added C++20 `starts_with`/`ends_with` and C++23 `contains` overloads. * Fixed bugs/issues: * [@https://github.com/boostorg/container/issues/323 GitHub #323: ['"flat_tree::try_emplace UB"]]. * [@https://github.com/boostorg/container/issues/328 GitHub #328: ['"boost::container::deque stores a redundant copy of the allocator, increasing size"]]. diff --git a/include/boost/container/string.hpp b/include/boost/container/string.hpp index fc88a54..2265cd2 100644 --- a/include/boost/container/string.hpp +++ b/include/boost/container/string.hpp @@ -2989,7 +2989,11 @@ class basic_string template