template class custom_allocator

Overview

template <typename T>
class custom_allocator
{
public:
    // typedefs

    typedef T value_type;
    typedef T* pointer;
    typedef const T* const_pointer;
    typedef T& reference;
    typedef const T& const_reference;
    typedef std::size_t size_type;
    typedef std::ptrdiff_t difference_type;
    typedef std::true_type propagate_on_container_move_assignment;

    // structs

    template <typename U>
    struct rebind;

    // construction

    custom_allocator();
    custom_allocator(const custom_allocator&);

    template <typename U>
    custom_allocator(const custom_allocator<U>&);

    // methods

    pointer address(reference x) const;
    const_pointer address(const_reference x) const;

    pointer allocate(
        size_type n,
        const void* = 0
        );

    void deallocate(
        T* p,
        size_type
        );

    size_type max_size() const;

    template <typename U, typename... Args>
    void construct(
        U* p,
        Args&&... args
        );

    template <typename U>
    void destroy(U* p);
};