|
From: Ioannis V. <no...@ho...> - 2002-04-08 01:40:37
|
> -----Original Message-----
> From: Julian Calderon Almendros [mailto:jul...@er...]
> Sent: Sunday, April 07, 2002 11:58 PM
> To: Ioannis Vranos; Dev-C++
> Subject: RE: [Dev-C++] static members
>
>
> The authentic problem is:
>
> template<unsigned n> class A
> {
> static int x;
> };
The above has no logical meaning (=mistake).
>
> int A<n>::x=0;//??n??
This has no meaning too.
#include <iostream>
template <class T>
class A
{
public:
static int x;
};
template<class T>
int A<T>::x=1;
int main()
{
A<int> a;
std::cout<<a.x<<" "<<A<int>::x<<std::endl;
}
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.cjb.net
* Alternative URL: http://run.to/noicys
|