Lesson Learned [30/07/2014]

1. Header file Derived Class Constructor need not call Base Class Constructor

2. All Base class template called by Derived Class must have template instantiation

3. Must have #ifndef, #define, #endif include guard

4. All references in object file must be fulfilled by subsequent libraries or object files. Order matters.

5. Virtual Destructor and Implementation

6. Cannot initialise Based Class member directly

7. Explicit Instantiation of Templates class must be of the following syntax
template class Foo<unsigned int, char *>;
template class Foo<short,std::string>;
Incorrect:
template Foo<unsigned int, char *>;
template Foo<short,std::string>;
   This would result in the error:
 
   ds/set_bst.cpp:10:10: warning: declaration does not declare anything [-Wmissing-declarations]
   template Set_BST<unsigned int,char*> 

Comments

Popular Posts