Skip to content

Instantly share code, notes, and snippets.

@Madsy
Created November 8, 2013 13:15
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 Madsy/7370895 to your computer and use it in GitHub Desktop.
Save Madsy/7370895 to your computer and use it in GitHub Desktop.
#ifndef CONTAINERS_H_GUARD
#define CONTAINERS_H_GUARD
#include <algorithm>
#include <utility>
#include <vector>
#include <list>
#include <map>
#include <string>
#include "../alloc/alloc.h" //custom allocators
template <class T>
using vector_wp = std::vector<T, gc_allocator<T>>;
template <class T>
using list_wp = std::list<T, gc_allocator<T>>;
template <class Key, class T>
using map_wp = std::map<Key, T, std::less<Key>, gc_allocator<std::pair<const Key, T>>>;
template <class T>
using vector_np = std::vector<T, gc_allocator_pointerless<T>>;
template <class T>
using list_np = std::list<T, gc_allocator_pointerless<T>>;
template <class Key, class T>
using map_np = std::map<Key, T, std::less<Key>, gc_allocator_pointerless<std::pair<const Key, T>>>;
template<class T>
using basic_string_wp = std::basic_string<T, std::char_traits<T>, gc_allocator<T>>;
template<class T>
using basic_string_np = std::basic_string<T, std::char_traits<T>, gc_allocator_pointerless<T>>;
typedef basic_string_wp<char> string_wp;
typedef basic_string_np<char> string_np;
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment