Boost logo

Boost :

From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2002-07-19 12:50:30


----- Original Message -----
From: "David Abrahams" <david.abrahams_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, July 19, 2002 1:26 PM
Subject: Re: [boost] boost::function< R (*) (A1, A2) >

>
> From: "Douglas Gregor" <gregod_at_[hidden]>
>
>
> > On Friday 19 July 2002 11:44 am, David Abrahams wrote:
> > > > Maybe version the old boost::function code (e.g., stick it in
> > > > boost::deprecated and supply an import library), and provide a
> completely
> > >
> > > new
> > >
> > > > version based on this syntax?
> > >
> > > If we could find a way to provide a warning for uses of the deprecated
> > > syntax as a transition plan, that would be ideal.
> >
> > I haven't seen any easy way to emit a warning at compile-time, but we
> could
> > guarantee to annoy the user at run-time if they use the deprecated
> syntax,
> > like this:
> >
> > struct deprecated_boost_function_syntax {
> > deprecated_boost_function_syntax()
> > {
> > std::cerr << "Warning: using deprecated Boost.Function syntax"
> > << std::endl;
> > // yada yada yada
> > }
> > };
>
> No thanks.
>
> How about inducing an unused variable warning?
> It's not reliable, but at least those who care will hear about it.
>
FWIW, I also like warnings as a method to output in compile_time. Though I
prefer something more scary like mixing sign/unsigned char pointers, or so,
something that the user probably didn't turned off.

I'm attaching here a header called 'static_print.hpp', which contains some
macros I use to do that, in case you're interested.

(disclaimer: the code looks as if it were part of boost, even if it isn't
really part of it. That's because I intended to submit it eventually).

Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com




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