Re: [Boost-bugs] [Boost C++ Libraries] #2519: Request for an empty function to be added to boost::xpressive::basic_regex

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2519: Request for an empty function to be added to boost::xpressive::basic_regex
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-11-20 08:00:18


#2519: Request for an empty function to be added to boost::xpressive::basic_regex
--------------------------------------+-------------------------------------
  Reporter: mgoldshteyn_at_[hidden] | Owner: eric_niebler
      Type: Feature Requests | Status: closed
 Milestone: Boost 1.38.0 | Component: xpressive
   Version: Boost 1.37.0 | Severity: Problem
Resolution: wontfix | Keywords: empty xpressive regex
--------------------------------------+-------------------------------------
Changes (by eric_niebler):

  * status: new => closed
  * resolution: => wontfix

Comment:

 boost::regex goes to some length to present itself as a souped up
 container of characters. You can assign a character range to it, get
 begin() and end() iterators for stepping through the characters with which
 the regex was initialized, etc. Given that, see if you can answer this
 without checking the docs:

 {{{
   assert(std::string().empty()); // OK
   assert(std::string("").empty()); // OK
   assert(boost::regex().empty()); // Is this true???
   assert(boost::regex("").empty()); // How about this???
 }}}

 Unsurprisingly, regex::empty() is not part of the standard regex interface
 in C++0x. I don't like regex::empty() and I'm not inclined to add it.
 Sorry. You already have a way to get the information you're interested in.
 If you would like to give it a pretty name, by all means...

 {{{
 template<class Iter>
 bool is_invalid(xpressive::basic_regex<Iter> const &rex)
 {
   return 0 == rex.regex_id();
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2519#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC