Boost logo

Boost :

From: Eric Weitzman (eweitzman_at_[hidden])
Date: 2000-11-02 14:19:21

Nice! Too bad this tidbit isn't in Stroustrup (unspecial edition),
page 854, section C.13.1.

Unfortunately, this also has the drawback (under vc6sp4, anyways) of
causing the static to be multiply defined if the same template
instantiation is made in more than one compilation unit. It seems
to be the equivalent of defining a non-template member in a header
and then including it in more than one compilation unit.


- Eric

> -----Original Message-----
> From: Michael Kenniston [mailto:mkenniston_at_[hidden]]
> Sent: Thursday, November 02, 2000 9:41 AM
> To: boost_at_[hidden]
> Subject: [boost] RE: Q: defining a static data member for a template
> class
> Stroustrup, Special Edition, page 854, section C.13.1 discusses this.
> One line in the header file will do what you want:
> template < class T > int C< T >::i_ = 0;
> - Michael Kenniston

Boost list run by bdawes at, gregod at, cpdaniel at, john at