callmeFilip / Thinking-in-CPP-Volume-1-2nd-Edition

Homework and Classwork repository
0 stars 0 forks source link

Chapter_16 Task_22 #352

Open callmeFilip opened 3 years ago

callmeFilip commented 3 years ago

Inherit a class StringVector from vector<void> and redefine the push_back( ) and operator[] member functions to accept and produce only string (and perform the proper casting). Now create a template that will automatically make a container class to do the same thing for pointers to any type. This technique is often used to reduce code bloat from too many template instantiations.