Answer the question
In order to leave comments, you need to log in
Is it possible to access a static field of a class template without instantiating the template?
Is there a syntax construct in C++ to access a public static constant in a class template from the outside?
Example:
template <typename T, int32_t maxSize>
class CircularBuffer
{
private:
/* Some code */
public:
static const int32_t MEMBER_TO_BE_ACCESSIBLE_OUTSIDE = 0;
};
CircularBuffer<int, 0>::MEMBER_TO_BE_ACCESSIBLE_OUTSIDE
, adding "dummy" template parameters is somehow too crutch.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question