auto source_allocator = source.get_allocator();
Is there a way of replacing auto
in the above with something C++03/98-friendly, in the event where the type of allocator is not known in advance?
Based on what you posted in the comments, it sounds like you're trying to do this inside a template.
Assuming you are expecting your templated type to be a std::container, or something compatible, you can do this:
typename T::allocator_type
in place of auto.