Should an empty boost::regex raise a 'bad expression' exception when
you assign it to another boost::regex object? It seems to me that an
empty expression can't be bad - it hasn't had the chance to be good OR
bad yet :-)
The rationale for this is that I have an object that contains a
boost::regex that is compiled on demand. The object is likely to be
copied (into a std::vector), before the regex has been compiled (if it
is ever compiled). I know I could use things like
boost::optionalboost::regex, or boost::scoped_ptrboost::regex (I
am working round it currently), but this seems like an interesting
corner case!
Here's a minimal sample:
#include <iostream>
#include