I'm using the STL allocator mentioned here.
The only change I'm making is that I'm inheriting from a base class called Object, and I use base class' new and delete functions for allocation.
class MyAlloc :public Object{ ...... } I want to use the parameterized constructor of the base class which will be based on parameter sent to the STLAllocator, which would be something like this.
MyAlloc(A *a) : Object(a) { ... } And then use this constructor like :
A *a = new A(); std::vector<int,MyAlloc<int> (a) > v; I'm not able to achieve this. It is resulting in compilation error :
'a'cannot appear in a constant-expression
template argument 2 is invalid
Thanks in advance..:)