This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17445] too few template-parameter-lists


------- Additional Comments From leslie dot barnes at amd dot com  2005-04-19 00:02 -------
(In reply to comment #6)
> This code has at least two bugs: 
>  
> template class MyType<Sample>; 
> template <> std::map<char*,char*> MyType<Sample>::m_map; 
>  
> First, the instantiation must come *after* the definition of the static 
> member. 
> Second, the definition you thought you have written is in fact only the  
> declaration of an explicit specialization of that member. It needs an 
> initializer. You need to write 
>  
> template <> std::map<char*,char*> MyType<Sample>::m_map 
>    = std::map<char*,char*>(); 
>  
> W. 
>  

(In reply to comment #6)
> This code has at least two bugs: 
>  
> template class MyType<Sample>; 
> template <> std::map<char*,char*> MyType<Sample>::m_map; 
>  
> First, the instantiation must come *after* the definition of the static 
> member. 
> Second, the definition you thought you have written is in fact only the  
> declaration of an explicit specialization of that member. It needs an 
> initializer. You need to write 
>  
> template <> std::map<char*,char*> MyType<Sample>::m_map 
>    = std::map<char*,char*>(); 
>  
> W. 
>  

Great, thanks!  If someone could put this on the g++ 3.4.3 changes page, that
would probably save people quite a bit of time.

http://www.gnu.org/software/gcc/gcc-3.4/changes.html

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17445


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]