Microsoft says: “Templates cannot be used with functions declared with __declspec (dllimport) or __declspec (dllexport).” (link).
What does this mean? Can I export a function which has a fully specialized template class reference as an argument?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That isn’t a
dllexport/dllimport-specific problem, its a general issue with templates – only one compiler currently implements the means toexporttemplates, see Comeaus template FAQ for details.Fully specialized templates however are distinct and concrete types and basically usable with the
__declspecextension, but there are limitations besides the entry you linked.Personally i’d mainly avoid templates in the interface here and only use them internally – i don’t see the what big benefits the time invested in working around the limitations give you.