Member function template 
Author Message
 Member function template

Hi,
I am new on templates and I am having a problem in use it:
On my dll (myDll1) I have a class (not a template class)
with a function member template. I dont have any problem
on use it on my dll.
The problem is when I try to use it on another dll
(Mydll2). I have link problem when I compile my
project : "undefined external symbols..."
Problably, my member function template was not instatiated.
Anyone have any solution or any sample code??

Thanks,
Aragao

#ifdef _SAGREINSTRUCTIONENGINEIMPEXP_
        #define SAGREINSTRUCTIONENGINEDLLIMPEXP __declspec
(dllexport)
        #define SAGREINSTRUCTIONENGINEEXTERN
#else
        #define SAGREINSTRUCTIONENGINEDLLIMPEXP __declspec
(dllimport)
        #define SAGREINSTRUCTIONENGINEEXTERN extern
#endif
#pragma warning (disable : 4231)

class CSgParam;
class CSgString;
#include <Sagre\inc\CSgDictionaryImpl.h>

//##ModelId=3BA25C440359
class  SAGREINSTRUCTIONENGINEDLLIMPEXP
CSgParamExchangeTable
{
public:
        virtual ~CSgParamExchangeTable();
        CSgParamExchangeTable();
        CSgParam* getAt(const CSgString& strKey) const;
        //member template function
        template < class T > Sag::ErrorStatus getParamAt
(const CSgString& strKey, T*& pObj)
        {
                CSgParam* pParam = getAt(strKey);
                if(pParam == NULL) return
Sag::eKeyNotFound;
                CSgParamPtr< T >* pParamPointer =
dynamic_cast< CSgParamPtr< T >* >(pParam);
                if(pParamPointer == NULL) return
Sag::eInvalidCast;
                pObj = pParamPointer->getVal();
                return Sag::eOk;
        }
        Sag::ErrorStatus setAt(const CSgString& strKey,
CSgParam* pObjParam);  
        Sag::ErrorStatus removeAll();
private:
        CSgDictionaryImpl<CSgString, CSgParam>*
m_pDictParam;

Quote:
};



Mon, 17 May 2004 18:51:27 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Simple question: Member function templates in template classes under VC++ 5.0

2. Using member function templates in template class under VC++ 5.0

3. member function template workaround ?

4. "member function templates with explicit specification"

5. Member function templates in VC 5.0

6. using structs as member function template parameter

7. Explicit instantiation of member function template

8. Member function Template

9. explicit member function template instantiation

10. member function templates

11. template class with a template member function

12. Template member functions of template classes

 

 
Powered by phpBB® Forum Software