www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/05/06/05:33:40

Date: Fri, 6 May 94 08:52:35 GMT
From: peter AT edna DOT vut DOT edu DOT au (Peter Kostouros)
Subject: Templates and named return values.
Apparently-To: djgpp AT sun DOT soe DOT clarkson DOT edu

Can named return values (GNU extension for C++) be used with templates as in:

template<class T>
class Vector
{
	public:
		...
	private:
		...
		unsigned long m_nLength;
};

...
template<class T>
Vector<T> Vector<T>::Add( const Vector<T>& UsrVec ) return Tmp( m_nLength );
{
	...
}

DJGPP generates the following message:
parse error in template specification before `return'
end of file read inside definition

A similar class, not utilising templates, works well. Any suggestions?

I am using DJGPP v1.11 maint5.

Thanks,

Peter


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019