Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2002-12-13 07:16:22


 
> 9 Users extremely strongly prefer to write "float area = pi * r * r;"
>
> 10 There is evidence that some compilers can generate better code from
> functions like
> "double pi() { return 3.1459;}"
> but that this implies writing pi() instead of plain "long double pi".
>
> So the ()s remain the main issue.

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;
}

?

Thorsten Ottosen, AAU


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