From f89c75f7b0b8ad9d8d204c365444c2612b88b6fe Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sat, 25 Mar 2017 20:34:56 +0300 Subject: [PATCH 1/4] Silence MSVC 14.1 warnings of narrowing conversion In debug mode the compiler is not able to see that the int constant can fit in the character type without loss. --- include/boost/regex/v4/basic_regex_creator.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index 132ff84f..623e06f1 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -43,8 +43,8 @@ namespace BOOST_REGEX_DETAIL_NS{ template struct digraph : public std::pair { - digraph() : std::pair(0, 0){} - digraph(charT c1) : std::pair(c1, 0){} + digraph() : std::pair(charT(0), charT(0)){} + digraph(charT c1) : std::pair(c1, charT(0)){} digraph(charT c1, charT c2) : std::pair(c1, c2) {} digraph(const digraph& d) : std::pair(d.first, d.second){} From 791c447922323b52bea36506edd1bd430a8b3446 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 9 Apr 2017 13:20:03 +0100 Subject: [PATCH 2/4] Escape back slashes Fixes Trac #12096. https://svn.boost.org/trac/boost/ticket/12096 --- doc/html/boost_regex/syntax/perl_syntax.html | 4 +-- doc/syntax_perl.qbk | 28 ++++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/doc/html/boost_regex/syntax/perl_syntax.html b/doc/html/boost_regex/syntax/perl_syntax.html index 9fd7546c..5426d9f2 100644 --- a/doc/html/boost_regex/syntax/perl_syntax.html +++ b/doc/html/boost_regex/syntax/perl_syntax.html @@ -578,12 +578,12 @@

-
+ \n

-
+ \n

diff --git a/doc/syntax_perl.qbk b/doc/syntax_perl.qbk index 2b8b13fb..0dc63c42 100644 --- a/doc/syntax_perl.qbk +++ b/doc/syntax_perl.qbk @@ -299,24 +299,24 @@ The following escape sequences are all synonyms for single characters: [table [[Escape][Character]] -[[[^\a]][[^\a]]] -[[[^\e]][[^0x1B]]] -[[[^\f]][[^\f]]] -[[[^\n]][[^\n]]] -[[[^\r]][[^\r]]] -[[[^\t]][[^\t]]] -[[[^\v]][[^\v]]] -[[[^\b]][[^\b] (but only inside a character class declaration).]] -[[[^\cX]][An ASCII escape sequence - the character whose code point is X % 32]] -[[[^\xdd]][A hexadecimal escape sequence - matches the single character whose +[[[^\\a]][[^\\a]]] +[[[^\\e]][[^0x1B]]] +[[[^\\f]][[^\\f]]] +[[[^\\n]][[^\\n]]] +[[[^\\r]][[^\\r]]] +[[[^\\t]][[^\\t]]] +[[[^\\v]][[^\\v]]] +[[[^\\b]][[^\\b] (but only inside a character class declaration).]] +[[[^\\cX]][An ASCII escape sequence - the character whose code point is X % 32]] +[[[^\\xdd]][A hexadecimal escape sequence - matches the single character whose code point is 0xdd.]] -[[[^\x{dddd}]][A hexadecimal escape sequence - matches the single character whose +[[[^\\x{dddd}]][A hexadecimal escape sequence - matches the single character whose code point is 0xdddd.]] -[[[^\0ddd]][An octal escape sequence - matches the single character whose +[[[^\\0ddd]][An octal escape sequence - matches the single character whose code point is 0ddd.]] -[[[^\N{name}]][Matches the single character which has the +[[[^\\N{name}]][Matches the single character which has the [link boost_regex.syntax.collating_names symbolic name] /name/. - For example [^\N{newline}] matches the single character \\n.]] + For example [^\\N{newline}] matches the single character \\n.]] ] [h5 "Single character" character classes:] From b9cad50387f7054fc350f1b49b3cfe4c808c23d4 Mon Sep 17 00:00:00 2001 From: Daniela Engert Date: Sun, 14 May 2017 16:37:59 +0200 Subject: [PATCH 3/4] Conditionally replace deprecated/removed C++98 std::bind1st by std::bind. Signed-off-by: Daniela Engert --- example/snippets/regex_grep_example_3.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/example/snippets/regex_grep_example_3.cpp b/example/snippets/regex_grep_example_3.cpp index 02aaa724..5bb3fd0a 100644 --- a/example/snippets/regex_grep_example_3.cpp +++ b/example/snippets/regex_grep_example_3.cpp @@ -89,6 +89,11 @@ void class_index::IndexClasses(const std::string& file) start, end, expression); +#elif defined(BOOST_NO_CXX98_BINDERS) + boost::regex_grep(std::bind(&class_index::grep_callback, this, std::placeholders::_1), + start, + end, + expression); #else boost::regex_grep(std::bind1st(std::mem_fun(&class_index::grep_callback), this), start, From 47635d073307004b4c69239791111be267cd8101 Mon Sep 17 00:00:00 2001 From: Vemund Handeland Date: Mon, 22 May 2017 15:39:45 +0200 Subject: [PATCH 4/4] Update icu.cpp Conditionally replace deprecated/removed C++98 std::bind2nd by std::bind --- src/icu.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/icu.cpp b/src/icu.cpp index 5d166a69..be6e5a1c 100644 --- a/src/icu.cpp +++ b/src/icu.cpp @@ -430,7 +430,11 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_classname(const char_ icu_regex_traits::string_type icu_regex_traits::lookup_collatename(const char_type* p1, const char_type* p2) const { string_type result; +#ifdef BOOST_NO_CXX98_BINDERS + if(std::find_if(p1, p2, std::bind(std::greater< ::UChar32>(), std::placeholders::_1, 0x7f)) == p2) +#else if(std::find_if(p1, p2, std::bind2nd(std::greater< ::UChar32>(), 0x7f)) == p2) +#endif { #ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS std::string s(p1, p2);