Quantcast
Channel: User rmn - Stack Overflow
Viewing all articles
Browse latest Browse all 39

Answer by rmn for Is there a way to have a single static variable for a template class (for all types) without breaking encapsulation

$
0
0

The syntax for

template <class T> friend class Foo<T>;

is

template <class T> friend class Foo;

(which means that every instantiation of Foo is a friend of the class you define it in)

So perhaps you can go with the solution you ruled out before.


Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>