I jumped into winnt.h
and I found out the code as following:
extern "C++" // templates cannot be declared to have 'C' linkage
template <typename T, size_t N>
char (*RtlpNumberOf( UNALIGNED T (&)[N] ))[N];
I'd like to ask questions as following:
- how does
extern "C++"
work? - is this portable among GCC, and Clang?
- can all templates be exported with this syntax?
With question 3, I mean that can I separate declearation and definition of the templates, and then generate a dynamic link for the template without actually give the implementation by using this trick?