When creating my own allocator in c++11 I am implementing the following interfaces. This works with vector but when trying to use this with map I get errors on missing items. I thought this was all I need to implement for c++11 since it will use allocator\_traits in the stl implementations. What am I missing here? Do I need to define more methods / data structures for an allocator for std::map? I am seeing the following errors when trying to compile currently (see below). Line 3 main.cpp is just 

```
#include <map>

template <class T> struct MyAllocator {
    typedef T value_type;
    MyAllocator() noexcept;  // only required if used
    MyAllocator(const MyAllocator&) noexcept;  // copies must be equal
    MyAllocator(MyAllocator&&) noexcept;  // not needed if copy ctor is good enough
    template <class U> MyAllocator(const MyAllocator<U>& u) noexcept; 
        // requires: *this == MyAllocator(u)
    value_type* allocate(std::size_t);
    void deallocate(value_type*, std::size_t) noexcept;
};

template <class T, class U> bool
operator==(const MyAllocator<T>&, const MyAllocator<U>&) noexcept;

```

Errors: 

> 
> In file included from
>  /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/map:61:0,  
> 
>  from main.cpp:3:  
> 
>  /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/bits/stl\_map.h: In
>  instantiation of ‘class std::map,
>  MyAlloc >’:  
> 
>  main.cpp:146:14: required from here  
> 
>  /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/bits/stl\_map.h:143:58:
>  error: no type named ‘pointer’ in ‘std::map,
>  MyAlloc >::\_Pair\_alloc\_type {aka class
>  MyAlloc, 200 typedef typename
>  \_Pair\_alloc\_type::pointer pointer; ^  
> 
>  /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/bits/stl\_map.h:144:58:
>  error: no type named ‘const\_pointer’ in ‘std::map, MyAlloc >::\_Pair\_alloc\_type {aka class
>  MyAlloc
>  /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/bits/stl\_map.h:145:58:
>  error: no type named ‘reference’ in ‘std::map, MyAlloc >::\_Pair\_alloc\_type {aka class
>  MyAlloc, 2 typedef typename
>  \_Pair\_alloc\_type::reference reference; ^  
> 
>  /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/bits/stl\_map.h:146:58:
>  error: no type named ‘const\_reference’ in ‘std::map, MyAlloc >::\_Pair\_alloc\_type {aka class
>  MyAlloc
>  In file included from
>  /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/map:60:0,  
> 
>  from main.cpp:3:  
> 
>  /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/bits/stl\_tree.h: In
>  instantiation of ‘void std::\_Rb\_tree<\_Key, \_Val, \_KeyOfValue,
>  \_Compare, \_Alloc>::\_M\_destroy\_node(std::\_Rb\_tree<\_Key, \_Val, \_KeyOfValue, \_Compare, \_Alloc>::\_Link\_t /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/bits/stl\_tree.h:1124:23:  
> 
>  required from ‘void std::\_Rb\_tree<\_Key, \_Val, \_KeyOfValue, \_Compare,
>  \_Alloc>::\_M\_erase(std::\_Rb\_tree<\_Key, \_Val, \_KeyOfValue, \_Compare, \_Alloc>::\_Link\_type /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/bits/stl\_tree.h:671:28:  
> 
>  required from ‘std::\_Rb\_tree<\_Key, \_Val, \_KeyOfValue, \_Compare,
>  \_Alloc>::~\_Rb\_tree() [with \_Key = int; \_Val = std::pair; \_KeyOfValue = std::  
> 
>  /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/bits/stl\_map.h:96:11:  
> 
>  required from here  
> 
>  /opt/gcc-4.8.1/usr/local/include/c++/4.8.1/bits/stl\_tree.h:421:2:
>  error: ‘std::\_Rb\_tree,
>  std::\_Select1st >, std::less,
>  MyAlloc, 200ul> >:  
> 
>  \_M\_get\_Node\_allocator().destroy(\_\_p); ^  
> 
>  make: \*\*\* [main.o] Error 1
> 
> 
>