From e35d64b486934f053f145442fc82204284832865 Mon Sep 17 00:00:00 2001 From: Orange Date: Mon, 6 Oct 2025 15:05:04 +0300 Subject: [PATCH] Disables rvalue overload of scan_for_pattern Prevents implicit conversions and unexpected behavior by deleting the rvalue overload of `scan_for_pattern`. --- include/omath/utility/pattern_scan.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/omath/utility/pattern_scan.hpp b/include/omath/utility/pattern_scan.hpp index 317bdaa..d8486f0 100644 --- a/include/omath/utility/pattern_scan.hpp +++ b/include/omath/utility/pattern_scan.hpp @@ -39,6 +39,10 @@ namespace omath static std::span::const_iterator scan_for_pattern(const std::span& range, const std::string_view& pattern); + [[nodiscard]] + static std::span::const_iterator scan_for_pattern(std::span&& range, + const std::string_view& pattern) = delete; + template requires std::input_or_output_iterator> static IteratorType scan_for_pattern(const IteratorType& begin, const IteratorType& end,