|
Boost : |
From: Paul A. Bristow (pbristow_at_[hidden])
Date: 2001-05-08 00:39:00
You are right. Sorry to confuse things even more.
Paul
> -----Original Message-----
> From: Peter Schmitteckert (boost) [mailto:boost_at_[hidden]]
> Sent: Friday, May 04, 2001 1:22 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] Math Constants Library formal review results
>
>
> Salut,
>
> On Thursday 03 May 2001 08:44, you wrote:
> > With your helpful question (answered with a further question
> below at end)
> > I am nearer to a solution, though not necessarily an efficient one.
> >
> > Paul
> [...]
> > template<class T>T constants<T>::pi = (T)3.1459L; // works BUT
> >
> > need to instantiate as
> >
> > constants<const double>::pi;
> >
> > rather than <double> - or you can alter it!
> [..]
> > Agreed. But I found you can then alter it!!!! pi = 999.;
> >
>
> constants<const double> is actually more accurate for constants :)
>
> But I can't reproduce your problem,
> see appended example.
>
> Best wishes
> Peter
> --------------------------------------------------------
> #include <iostream> template<typename T> class Q { public:
> static const T zz; }; template<> const int Q<int>::zz = 17;
> template<> const double Q<double>::zz = 42; int main() {
> Q<double> q; q.zz = 34; std::cout << "int: " <<
> q.zz << std::endl; return 0; } --------------------
> Configuration: MSVC_Test - Win32 Debug Compiling... t1.cpp
> V:\NRG++\MSVC_Test\t1.cpp(20) : error C2166: l-value specifies
> const object Error executing cl.exe. MSVC_Test.exe - 1 error(s),
> 0 warning(s)
> To unsubscribe, send email to: <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