Skip to content

Instantly share code, notes, and snippets.

@bastih
Last active December 19, 2015 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bastih/5947369 to your computer and use it in GitHub Desktop.
Save bastih/5947369 to your computer and use it in GitHub Desktop.
#ifdef _LIBCPP_VERSION
template <
typename kT,
typename vT,
typename comp=typename std::map<kT, vT>::key_compare,
typename alloc=alloc_adapter<typename std::map<kT, vT>::value_type>
>
using map = std::map<kT, vT, comp, alloc>;
#else
//c++11-ify map re allocation
template<
class Key,
class T,
typename Compare=typename std::map<Key, T>::key_compare,
typename Allocator=alloc_adapter<typename std::map<Key, T>::value_type>
>
class map : public std::map<Key, T, Compare, Allocator> {
public:
inline explicit map(const Allocator& alloc) : std::map<Key, T, Compare, Allocator>(Compare(), alloc) {}
};
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment