#define Create_Function(Type) \
template void Function( std::vector<boost::shared_ptr<Type>>&)
Create_Function(std::string);
I have seen the above code in legacy code but have no idea what the meaning of it. It is neither a regular non-specialized function definition nor a full specialized function definition.
Any idea?
It does explicit template instantiation (see MSDN)
Explicit instantiation lets you create an instantiation of a templated class or function without actually using it in your code. Because this is useful when you are creating library (.lib) files that use templates for distribution, uninstantiated template definitions are not put into object (.obj) files.
Given a general function template
template<typename T>
void Function( std::vector<boost::shared_ptr<T>>&)
{
// bla bla
}
The call to the macro Create_Function(std::string);
will expand to
template void Function( std::vector<boost::shared_ptr<std::string>>&);