I am trying to compile with g ++ 4.4 and link a simple program using STL. I am trying to do this with -fno-implicit-templates, so all templates must be created explicitly.
I do not understand why this code works:
#include <map>
template class std::_Rb_tree<char, std::pair <char const, char>,
std::_Select1st<std::pair<char const, char> >,
std::less<char>, std::allocator<std::pair<char const, char> > >;
int main() {
std::map <char,char> table;
return 0;
}
I would expect this program to need a line: template class std::map<char,char>;however this line does not make a link to the program. Required std::_Rb_tree line. Why?
Thanks in advance, any hint would be appreciated.
source
share