Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I export templated classes from a dll without explicit specification?

Tags:

c++

templates

dll

I have a dll that contains a templated class. Is there a way to export it without explicit specification?

like image 696
Boyan Avatar asked Dec 12 '08 13:12

Boyan


1 Answers

Since the code for templates is usually in headers, you don't need to export the functions at all. That is, the library that is using the dll can instantiate the template.

This is the only way to give users the freedom to use any type with the template, but in a sense it's working against the way dlls are supposed to work.

like image 130
James Hopkin Avatar answered Sep 24 '22 06:09

James Hopkin