Relative Content

Tag Archive for c++templatesg++

“expected unqualified-id before <> token” when defining template in cpp file with g++ [duplicate]

This question already has answers here: Explicit template instantiation – when is it used? (4 answers) Why can templates only be implemented in the header file? (19 answers) Closed 1 hour ago. I have this code in 3 files: ResourceCounter.h #ifndef RESOURCE_COUNTER_H_ #define RESOURCE_COUNTER_H_ template<typename Resource_t> class ResourceCounter { public: ResourceCounter(Resource_t max_, Resource_t consumed_ = […]