[osg-submissions] solaris membertemplate fix

Mathias Fröhlich M.Froehlich at science-computing.de
Sun Jun 29 23:21:43 PDT 2008


Robert,

On Friday 27 June 2008 18:15, Robert Osfield wrote:
> Having two code paths for the same thing just work around a problem
> with a compiler is just going to cause problems long term, we'll need
> to find a solution that uses a single code path on all platforms,
> potentially this could be to just use the static function path that
> you've introduced.
While I tend to agree, I had the impression that here an std::list is really a 
good idea in terms of insert and remove complexity.
Therefor I wanted to preserve that runtime behaviour with this change.

> Just to make sure I understand the compile problem under Solaris, its
> a problem with std::list::sort() not handling the functor?  Previous
> code used to use a std::vector<> and std::sort associated with it,
> with is a templated function, so perhaps this is why it used to
> compile.
No member templates in stl containers.
So

class X {
public:
	template<typename T>
	void foo(T)
        {}
};

will not work on solaris. Non of them ...

Sadly, they preserve backwards compatibility to prehistoric compiler and 
library versions here.

The compiler a such can handle that for a long time now. But the std c++ 
library does not make use of it.

There is an alternative stl implementation available that is based on stlport 
which provides this members. But we have some other constraints that stops us 
from using that.
Anyway, of the average library user it would be good to have something 
that 'just works' ...

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 




More information about the osg-submissions mailing list