Sabhareesh Ravichandran Sabhareesh Ravichandran - 2 years ago 98
C++ Question

Does default argument of template class, instantiate the template?

Does the following default argument for the template instantiates a template with type


class EmptyClass{};

template <typename TYPE=EmptyClass>
class Sample
static void test()

Answer Source

No, in that code any instance of EmptyClass is created. Serialize is a static function. And EmptyClass's constructor is never called (in code showed)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download