Specifying precision in vector<mpf_class>?

Felix E. Klee felix.klee.gmp@gmx.net
Wed, 16 Jul 2003 10:49:36 +0200


On Wednesday 16 July 2003 10:29, Ballabio Gerardo - Dip. di Scienza dei 
Materiali wrote:
> > If there's no easy way: Has someone considered adding the
> > precision as a template parameter? That way one could write
> > "std::vector<mpf_class<PREC> > some_vector".
>
> I did consider that when I started coding gmpxx.h, but at that time
> g++ couldn't handle it (I guess it was g++ 2.91, or maybe g++ 2.8).
> Current g++ probably can (I haven't tried), but I doubt that it would
> be definitely better than how it is done now. (But if you can show me
> why it's better, I'm willing to reconsider it.)

As I wrote in my reply to Kevin's message, one could use template parameters 
to define new types like "very_long_double". Although I don't see any 
technical advantages over the current solution, this feature would IMHO 
make programs more readable.

Felix

-- 
To contact me in private don't reply but send mail to
    felix DOT klee AT inka DOT de