In my example, the T is one specific type. So you could have std::vector<Cat>. If you also have Dogs, you just make another vector std::vector<Dog>. It works fine with the standard allocator. You don't have to do anything special.
If you wanted a factory that allocated vectors of a variety of known types, you'd probably declare template <typename T> before the generator function, so that on compilation a separate version of that function would be emitted for each type you passed to it.
(Not really a c++ expert, but that's my understanding; someone more knowledgeable can correct me).
markisus|2 years ago
neeeeees|2 years ago
pagghiu|2 years ago
I have not been working (yet) on custom allocators, but that's on the roadmap: https://pagghiu.github.io/SaneCppLibraries/library_container...
noduerme|2 years ago
(Not really a c++ expert, but that's my understanding; someone more knowledgeable can correct me).
CyberDildonics|2 years ago
emi2k01|2 years ago