Freigeben über


ALLOCATOR_DECL (<allocators>)

Ergibt eine Zuweisungsvorlagenklasse.

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

Hinweise

Das Makro ergibt eine Vorlagendefinition template <class Type> class name {.....} und eine Spezialisierung template <> class name<void> {.....}, die zusammen eine Zuweisungsvorlagenklasse definieren, die den Synchronisierungsfilter sync und einen Cache Typ cache verwendet.

Für die Compiler, kompilieren können, binden Sie, die resultierenden Vorlagendefinitionsaussehung wie folgt neu:

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;
            };
    };

Für die Compiler, nicht kompilieren können, binden Sie die erhaltenen Vorlagendefinitionsaussehung wie folgt neu:

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; }
    };

Anforderungen

Zuweisungen Header: <>

Namespace: stdext

Siehe auch

Referenz

<allocators>