I've recently replaced some Vector/Matrix classes with ones that use SSE, and am now making sure that the memory is aligned properly.
Following the advice in the answer to this question, I've replaced operator new/delete for the classes that require it and have started work on a custom allocator to use with STL containers - however, there seems to be some conflict between the two:
To get started, I've simply copied and pasted the sample allocator class from here, which compiles fine when I use it with a std::vector of the types in question without my custom new/delete, but when I replace those functions, I get an error "no matching function for call to 'operator new'" from the construct() function,
void construct(pointer p, const T& t) { new(p) T(t); }
I guess the fact that I've replaced the "usual" new has somehow obscured placement new? However, given that I can't write my own placement new for it to pick up, I'm not really sure what to do... I'm new (NPI) to the whole custom memory allocation thing, so any advice would be much appreciated!
I'm compiling on Linux using Clang v3.4 (or gcc 4.1.2); not using C++11.
Many thanks.