I am attempting to create a template function as follows:
template <typename T> DWORD GetRegistryDword (T key)
The function works perfectly, but when I try to place it in a separate source file, I get a LNK1120, unresolved external. I have created the files as follows:
template <typename T> DWORD GetRegistryDword (T key);
(see above implementation)
DWORD dwReturn = GetRegistryDword("HKEY_LOCAL_MACHINE\\...\\blah");
I have noticed that when I move my implementation into registry.h I no longer get the unresolved external in main.cpp, but I don't really want to place the entire implementation for all of my template functions into header files. Is there any way around this?