Boost C++ Libraries: Ticket #12705: wsregex_iterator construction failed https://svn.boost.org/trac10/ticket/12705 <p> code segment: </p> <blockquote> <p> std::wstring str = L"value(\"@methodSubType\", $method) =\"场地平整\""; static wregex blankPattern(L"<sup><br />s+"); wsregex_iterator spaceIter(begin, end, blankPattern); </sup></p> </blockquote> <p> call stack: </p> <blockquote> <p> 3.regex_iterator_implementation(const regex_type* p, <a class="missing wiki">BidirectionalIterator</a> last, match_flag_type f) </p> <blockquote> <p> : base(), end(last), re(*p), flags(f){} </p> </blockquote> <p> 2.regex_iterator(<a class="missing wiki">BidirectionalIterator</a> a, <a class="missing wiki">BidirectionalIterator</a> b, </p> <blockquote> <blockquote> <p> const regex_type&amp; re, match_flag_type m = match_default) : pdata(new impl(&amp;re, b, m)) </p> </blockquote> </blockquote> <p> 1.wsregex_iterator spaceIter(begin, end, blankPattern); </p> </blockquote> <p> in regex_iterator_implementation, variable re init failed.the m_px of re is 0. this problem presents sometimes. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12705 Trac 1.4.3 John Maddock Thu, 29 Dec 2016 11:01:33 GMT <link>https://svn.boost.org/trac10/ticket/12705#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12705#comment:1</guid> <description> <p> You will need to provide a complete, self contained test case for me to investigate. </p> <p> However, this looks like it might be the usual C++ order-of-initialization issue, which is to say, I suspect you are constructing the regex_iterator in progam startup code before the static regex instance is constructed. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>John Maddock</dc:creator> <pubDate>Thu, 09 Feb 2017 19:11:00 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/12705#comment:2 https://svn.boost.org/trac10/ticket/12705#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">worksforme</span> </li> </ul> <p> Please reopen if you can provide a test case. </p> Ticket