Smith-Rowland, Edward M (Contractor) wrote:

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-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 );

}

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 );

}

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


It turns out I was using some old 4.1 snapshot rather than 4.0 when this strange code passed.

The operator overload without template stuff fails (correctly) for the latest 4.1 snap, 4.0.2, etc.

Nothing to see here, move along.

Ed


Reply via email to