
6 Jan
2009
6 Jan
'09
10:48 p.m.
I want to create a STL allocator that uses a class's static new function if it exists and will fallback on std::allocator::allocate if it doesn't. I think it should be easy to do this with sfinae but I don't see an appropriate type trait to detect if a class provides allocation and deallocation functions. Should these be provided? Maybe boost::has_allocation_function<T> boost::has_deallocation_function<T> or just boost::has_new<T> boost::has_delete<T> -- Michael Marcin