Initialization of static data member of template class 
Author Message
 Initialization of static data member of template class

In the "standalone" initial build of our application, we successfully used
the following code:

// getTheBuilderCatalog - get a reference to the builder catalog
template <class AbstractClass, class Key, class Params>
OMMap <Key, AbstractBuilder <AbstractClass, Key, Params>*>& AbstractBuilder
<AbstractClass, Key, Params> :: getTheBuilderCatalog ()
{
    static OMMap <Key, AbstractBuilder <AbstractClass, Key, Params>*>
theBuilderCatalog;
    return theBuilderCatalog;

Quote:
}

Now, I'm attempting to build this as a library, then link to the (new)
application GUI. There are no compile errors (as I'd expect: nothing
changed!), but at runtime, it appears that this returns a null reference.

Any suggestions as to why the "standalone" version returns a valid
reference, but the attempt to incorporate this into a library returns a null
reference? I've checked my linker options several times, but find no
(obvious) explanation there...

Thanks for any suggestions,
Mark



Fri, 13 Dec 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. static data member of template class

2. static member-initialization of templated class

3. Initialization of static class members

4. initialization order of static class member

5. struct initialization (with static, const static members)

6. Unresolved static template data member exported from DLL

7. template classes with static members

8. template classes with static members

9. Static member definition of template class fails

10. Static member definition of template class fails

11. Static member variables of template class

12. static template class member variable in DLL

 

 
Powered by phpBB® Forum Software