Einzelnen Beitrag anzeigen

NicoDE
(Gast)

n/a Beiträge
 
#4

Re: [VS 2003] Probleme mit template-Klassen + globalen Opera

  Alt 6. Jul 2005, 18:09
Ich kann dir zwar (mangels VS71 auf diesem OS) die Frage vorerst nicht beantworten, aber bei Templates benutze ich seit geraumer Zeit .inl für die Implementation von Templates in Headern...

foo.hpp
Code:
//...
class CFoo
{
//...
};
//...
template < class ELEMENT >
class TFoo : public CFoo
{
//...
            ELEMENT&   operator [] ( int a_iIndex );
    const  ELEMENT&   operator [] ( int a_iIndex ) const;
//...
};
//...
#include   "foo.inl"
//...
foo.inl
Code:
//...
template < class ELEMENT >
ELEMENT& TFoo< ELEMENT >::operator [] ( int a_iIndex )
{
//...
}
template < class ELEMENT >
const ELEMENT& TFoo< ELEMENT >::operator [] ( int a_iIndex ) const
{
//...
}
//...
Copy 'n Paste; Fehler inklusive
  Mit Zitat antworten Zitat