2

AFAIK #pragma make_public supports only native non-template types.

But, is there some other way to make template type as public?

Erwin
  • 4,757
  • 3
  • 31
  • 41
Oleksandr Shtykhno
  • 766
  • 2
  • 7
  • 12

2 Answers2

1

Templates don't have external linkage. Not in native C++, not in C++/CLI either. You solve it the same way, put them in a .h header file and #include it in any source file where you want to use the template. They are of course not available to any other managed code that isn't written in C++/CLI.

Do favor the generic keyword in C++/CLI, generics in managed code do have the equivalent of external linkage.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536