From 26447e77b81703e40322cf3fc5ba216039035e9e Mon Sep 17 00:00:00 2001 From: Giel van Schijndel Date: Sat, 7 Feb 2015 18:27:23 +0000 Subject: [PATCH] make sub_match usable with Boost.Range --- include/boost/regex/v4/sub_match.hpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/boost/regex/v4/sub_match.hpp b/include/boost/regex/v4/sub_match.hpp index 7ce8d5397..92a35ad61 100644 --- a/include/boost/regex/v4/sub_match.hpp +++ b/include/boost/regex/v4/sub_match.hpp @@ -188,6 +188,30 @@ typedef sub_match wcsub_match; typedef sub_match wssub_match; #endif +template +inline typename sub_match::iterator range_begin(sub_match& m) +{ + return m.first; +} + +template +inline typename sub_match::const_iterator range_begin(const sub_match& m) +{ + return m.first; +} + +template +inline typename sub_match::iterator range_end(sub_match& m) +{ + return m.second; +} + +template +inline typename sub_match::const_iterator range_end(const sub_match& m) +{ + return m.second; +} + // comparison to std::basic_string<> part 1: template inline bool operator == (const std::basic_string::value_type, traits, Allocator>& s,