Boost logo

Boost :

From: John Maddock (jm_at_[hidden])
Date: 2002-12-13 07:24:43


> Why won't this work:
>
> struct Pi_impl
> {
> operator float() const
> { return 3.14...; }
>
> operator double() const
> { return 3.14.................; };
>
> operator long double() const
> { return 3.14..............................;}
> };
>
> namespace boost
> {
> const Pi_impl pi;
> }
>
> ?

Template function overload resolution is one:

std::abs(pi); // oops error

another is that it is not extensible: how for example should I add constants
for boost::interval? Or some other as yet unthought of (or user defined)
type?

John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm


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