ALLOCATOR_DECL (<allocators>)
Rende una classe modello di allocatore.
#define ALLOCATOR_DECL(cache, sync, name) <alloc_template>
Note
La macro genera una definizione di modello template <class Type> class name {.....} e una specializzazione template <> class name<void> {.....} che definiscono insieme una classe modello di allocatore che utilizza il filtro sync sincronizzati e una cache di tipo cache.
Per i compilatori che è possibile compilare riassociare, l'aspetto risultanti la definizione di modello alla seguente:
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;
};
};
Per i compilatori non è possibile compilare riassociare l'aspetto risultanti la definizione di modello alla seguente:
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; }
};
Requisiti
intestazione: <allocators>
Stdext diSpazio dei nomi: