home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!unipalm!uknet!mcsun!corton!seti!goudurix.inria.fr!edelson
- From: edelson@goudurix.inria.fr (Daniel Edelson)
- Newsgroups: comp.lang.c++
- Subject: Re: template static data members
- Message-ID: <4086@seti.UUCP>
- Date: 19 Aug 92 08:42:56 GMT
- References: <Bt5FDH.DFK@apollo.hp.com>
- Sender: news@seti.UUCP
- Reply-To: Daniel R. Edelson <edelson@sor.inria.fr>
- Organization: INRIA -- Institut National de Recherche en Informatique et Automatique -- Rocquencourt, France
- Lines: 23
-
- In article <Bt5FDH.DFK@apollo.hp.com>, vinoski@apollo.hp.com (Stephen Vinoski) writes:
- |>
- |> ...
- |>
- |> template<class T> Simple LessSimple<T>::s;
- |>
- <problem and explanation omitted>
- |>
- |> Unfortunately, in the example case
- |> above, ``s'' cannot be explicitly initialized, and the problem cannot
- |> be solved without changing the declaration of Simple so such
- |> initialization is allowed (if possible).
- |>
- |> -steve
-
- Can't it be initialized with a temporary which the compiler
- may or may not optimize away?
-
- template<class T> Simple LessSimple<T>::s = Simple();
-
- (Not that this makes the bug much less annoying.)
-
- daniel
-