Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-03-28 10:30:43


At 06:13 AM 3/28/2002, John Maddock wrote:
>> The boost/filesystem/directory.hpp header I'm working on has a couple
of
>> signatures that take "const regex &" arguments.
>>
>> I really don't want to #include boost/regex.hpp since many uses of the
>> directory.hpp header will not use regex.
>>
>> Has there been any discussion of providing a regex_fwd.hpp header?
>
>Good point, there hasn't really been any discussion, but I'll look into
it,
>I think it should be possible - provided default template arguments on a
>forward declaration don't trip up any compilers - I'll experiment and see
>what happens. Is it just boost::reg_expression (and typedefs thereof)
that
>you need?

The use is to have a header which supplies a declaration:

    void some_function( const boost::regex & arg );

Because the function is a minor one, used only by a few users of the
header, I would rather include boost/regex_fwd.hpp than boost/regex.hpp.

Right now, if I include boost/regex.hpp, a test program fails to link on
VC++ 7.0 if a regex library isn't available, even though the user program
never uses some_function(), and contains no other regex uses. A
regex_fwd.hpp header should avoid that, if at all possible.

--Beman


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