Quote:Original post by stonemetal
have you tried boxing the int?
somthing like
struct PoolID{
PoolID(int a): Pool(a){}
int Pool;
};
vector<int, myalloc<int, PoolID(5)> > foo;
That way you have a unified type for your template.
I'm a bit lost with this suggestion. How should the myalloc template class look like? I mean if I declare it as:
template<typename T, typename T2> class myalloc {} it won't compile, because it would expect a typename not an instance of an actual class for T2.
If I tried template<typename T, PoolID T2> class myalloc {} that won't work either, because PoolID is not a constant type and therefore can't be resolved as a template parameter, or am I missing the point here?