Boost logo

Boost :

From: chengst87 (christian.engstrom_at_[hidden])
Date: 2001-12-18 11:25:08


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.


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