다음을 통해 공유


ALLOCATOR_DECL(<allocators>)

Yields an allocator template class.

#define ALLOCATOR_DECL(cache, sync, name) <alloc_template>

설명

The macro yields a template definition template <class Type> class name {.....} and a specialization template <> class name<void> {.....} which together define an allocator template class that uses the synchronization filter sync and a cache of type cache.

For compilers that can compile rebind, the resulting template definition looks like this:

template <class Type> class name
    : public stdext::allocators::allocator_base<Type, sync<cache > >
    {
    public:
        name() {}
        template <class Other> name(const name<Other>&) {}
        template <class Other> name& operator = (const name<Other>&)
            {return *this; }
        template <class Other> struct rebind
            {    /* convert a name<Type> to a name<Other> */
            typedef name<Other> other;
            };
    };

For compilers that cannot compile rebind the resulting template definition looks like this:

template <class Type< class name
    : public stdext::allocators::allocator_base<Type,
        sync<stdext::allocators::rts_alloc<cache > > >
    {
    public:
        name() {}
        template <class Other> name(const name<Other>&) {}
        template <class Other> name& operator = (const name<Other>&)
            {return *this; }
    };

요구 사항

Header: <allocators>

네임스페이스: stdext

참고 항목

참조

<allocators>