This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Possible accept wrong code in C++?
- From: Ed Smith-Rowland <3dw4rd at verizon dot net>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 21 Feb 2006 20:13:59 -0500
- Subject: Possible accept wrong code in C++?
All,
I have a template class:
template < class Datum, unsigned long Dim >
class DataGrid
{
...
public:
...
std::ostream & write( std::ostream & output ) const;
...
};
I have a non-member operator overload:
On GCC-3.4 Cygwin I needed:
template < class Datum, unsigned long Dim >
inline std::ostream & operator<<( std::ostream & output, const
DataGrid<Datum,Dim> & data_grid )
{
return data_grid.write( output );
}
On GCC-4.0 MacOSX I was able to get by with this:
inline std::ostream & operator<<( std::ostream & output, const DataGrid
& data_grid )
{
return data_grid.write( output );
}
I actually think that 3.4 is right!!!
Am I wrong?
I'll try mainline and 4.1 when I get back home.
Ed Smith-Rowland