J
Joseph Turian
Okay, bear with me for a second here. This is a general C++ question.
In g++ 3.2.3, I can control the allocator as follows:
vector<int, __single_client_alloc> v;
In g++ 3.4, however, they removed this functionality, so I must do:
vector<int> v;
Now, to make the code portable, I could have something like this:
#ifdef SINGLE_CLIENT_ALLOC
vector<int, __single_client_alloc> v;
#else
vector<int> v;
#endif
where SINGLE_CLIENT_ALLOC is determined by a configuration script.
However, this solution is undesirable because I have to replace many
single line declarations with five lines.
Can I define a macro SCA, s.t. 'SCA(vector<int>) v' that would have the
desired effect?
If not, is there a single-line solution to choose between using the two
template parameters or not?
Joseph
In g++ 3.2.3, I can control the allocator as follows:
vector<int, __single_client_alloc> v;
In g++ 3.4, however, they removed this functionality, so I must do:
vector<int> v;
Now, to make the code portable, I could have something like this:
#ifdef SINGLE_CLIENT_ALLOC
vector<int, __single_client_alloc> v;
#else
vector<int> v;
#endif
where SINGLE_CLIENT_ALLOC is determined by a configuration script.
However, this solution is undesirable because I have to replace many
single line declarations with five lines.
Can I define a macro SCA, s.t. 'SCA(vector<int>) v' that would have the
desired effect?
If not, is there a single-line solution to choose between using the two
template parameters or not?
Joseph