Hello forum!
So as we know VS not supported export templates and extern templates can only assign to explicit decalarations!
So, we have:
![]()
How to hide include classes for template implementation from global space (expecting: visible only class A - if include A, but visible both - if include A and B)?
So as we know VS not supported export templates and extern templates can only assign to explicit decalarations!
So, we have:
//B.h #pragma once namespace C { template <typename T> class B { public: B() { } ~B() { } }; }
//A.h #pragma once #include "B.h" namespace C { template <typename T> class A { public: A() { //something doing with B } ~A() { } }; }
//main.h #include "A.h" int main() { C:://this place cursor for check return 0; }As we see - class A using class B only for implementation and if we check namespace C at main? we can see:

How to hide include classes for template implementation from global space (expecting: visible only class A - if include A, but visible both - if include A and B)?