Boost logo

Boost :

From: John Maddock (John_Maddock_at_[hidden])
Date: 2001-12-19 06:57:50


>The following program:

#include <boost/regex.hpp>
void main() {
  boost::regex aa;
  boost::regex bb(aa);
}

throws the exception boost::bad_expression("Empty expression.") when
executed. The reason is of course that the regex aa is empty at the
point where it is used to initialize bb.

My quesion is: is there any particular reason for this, or should
this be considered a bug in the regex package?

I personnaly cannot see why it should be more illegal to use an empty
regex object to initialize another one than it was to create the
emtpy regex object in the first place. The analogy with other types
would also suggest that this should be legal, since, for instance, it
is perfectly legal to initialize a string with another string that is
empty, or an integer with another integer that is 0. If there are
some arguments against this I would be very interested to hear them,
if not, I am hereby submitting this as a bug report.
<

Yes, I know about that, and it's on my list to change.

- John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk