--- description: "Learn more about: macros" title: " macros" ms.date: "11/04/2016" f1_keywords: ["allocators/std::ALLOCATOR_DECL", "allocators/std::CACHE_CHUNKLIST", "allocators/std::CACHE_FREELIST", "allocators/std::CACHE_SUBALLOC", "allocators/std::SYNC_DEFAULT"] ms.assetid: 9cb5ee07-1ff9-4594-ae32-3c8c6efb511a helpviewer_keywords: ["std::ALLOCATOR_DECL [C++]", "std::CACHE_CHUNKLIST [C++]", "std::CACHE_FREELIST [C++]", "std::CACHE_SUBALLOC [C++]", "std::SYNC_DEFAULT [C++]"] --- # `` macros :::row::: :::column span=""::: [`ALLOCATOR_DECL`](#allocator_decl)\ [`CACHE_CHUNKLIST`](#cache_chunklist) :::column-end::: :::column span=""::: [`CACHE_FREELIST`](#cache_freelist) :::column-end::: :::column span=""::: [`CACHE_SUBALLOC`](#cache_suballoc) :::column-end::: :::column span=""::: [`SYNC_DEFAULT`](#sync_default) :::column-end::: :::row-end::: ## ALLOCATOR_DECL Yields an allocator class template. ```cpp #define ALLOCATOR_DECL(cache, sync, name) ``` ### Remarks The macro yields a template definition `template class name {.....}` and a specialization `template <> class name {.....}` which together define an allocator class template 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: ```cpp struct rebind { /* convert a name to a name */ typedef name other; }; ``` For compilers that cannot compile rebind the resulting template definition looks like this: ```cpp template >> { public: name() {} template name(const name&) {} template name& operator= (const name&) { return *this; } }; ``` ## CACHE_CHUNKLIST Yields `stdext::allocators::cache_chunklist`. ```cpp #define CACHE_CHUNKLIST ``` ### Remarks ## CACHE_FREELIST Yields `stdext::allocators::cache_freelist`. ```cpp #define CACHE_FREELIST(max) ``` ### Remarks ## CACHE_SUBALLOC Yields `stdext::allocators::cache_suballoc`. ```cpp #define CACHE_SUBALLOC ``` ### Remarks ## SYNC_DEFAULT Yields a synchronization filter. ```cpp #define SYNC_DEFAULT ``` ### Remarks If a compiler supports compiling both single-threaded and multi-threaded applications, for single-threaded applications the macro yields `stdext::allocators::sync_none`; in all other cases it yields `stdext::allocators::sync_shared`. ## See also [\](allocators-header.md)