Boost logo

Boost :

From: Lyell E. Haynes (fizban_at_[hidden])
Date: 2001-10-24 12:31:17


Why not use a typedef approach, similar to std::string =
std::basic_string<char>?

Then we could have:

typedef constant<pi_tag, double> pi

and in you code, you can either write:
v = pi; or
v = constant<pi_tag, double>

Then you get the template approach as well as ease of typing. Has this
already been suggested, and I just missed it?

Lyell "lurker" Haynes

On Wed, 24 Oct 2001, Greg Colvin wrote:

> From: Beman Dawes <bdawes_at_[hidden]>
> > At 05:14 PM 10/23/01 -0600, Greg Colvin wrote:
> >
> > >The only problems I see with the template function approach is
> > >the extra typing:
> > >
> > > v = pi
> > >
> > >is certainly easier than
> > >
> > > v = constant<pi_tag,double>
> > >
> > >but it is not amenable to more precise implementations.
> > >
> > >How about a compromise:
> > >
> > > v = pi<double>()
> > >
> > >and so on for all the other constants? I think this can be
> > >made to work with even the most brain-dead compilers.
> >
> > Please do not make any design decisions for math constants based on
> > brain-dead compilers.
>
> OK. But I still prefer pi<double> to constant<pi_tag,double>, so I
> was compromising on the interface.
>
> > I'm writing this from the C++ committee meeting. Compiler vendor after
> > compiler vendor is stating publicly that the Boost libraries have become so
> > important that they are being added to the vendor's regression tests.
> > Customers are demanding that 100% of the tests pass. The critical mass
> > demand we all dreamed about actually seems to be happening.
>
> Excellent.
>
>
> > The exact form of the constants will be very, very important in user
> > decisions to use the library, and committee decisions to add the library to
> > the C++ standard. Please don't make compromises for broken compilers.
> >
> > --Beman
> >
> >
> > Info: http://www.boost.org Unsubscribe: <mailto:boost-unsubscribe_at_[hidden]>
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
> >
>
>
> Info: http://www.boost.org Unsubscribe: <mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


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