---
name: "std::scoped_allocator_adaptor"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::scoped_allocator_adaptor"
---

# std::scoped\_allocator\_adaptor(3)

An adaptor to recursively pass an allocator to the objects it constructs.

## NAME

std::scoped\_allocator\_adaptor\< \_OuterAlloc, \_InnerAllocs \> - An adaptor to recursively pass an allocator to the objects it constructs.

## SYNOPSIS

\#include \<scoped\_allocator\>

### Public Types

typedef **\_\_traits::const\_pointer** **const\_pointer**\
 typedef **\_\_traits::const\_void\_pointer** **const\_void\_pointer**\
 typedef **\_\_traits::difference\_type** **difference\_type**\
 typedef \_\_inner\_type::\_\_type **inner\_allocator\_type**\
 typedef \_\_and\_\< typename\_\_traits::is\_always\_equal, typenameallocator\_traits\< \_InnerAllocs \>::is\_always\_equal... \>::type **is\_always\_equal**\
 typedef \_OuterAlloc **outer\_allocator\_type**\
 typedef **\_\_traits::pointer** **pointer**\
 typedef \_\_or\_\< typename\_\_traits::propagate\_on\_container\_copy\_assignment, typenameallocator\_traits\< \_InnerAllocs \>::propagate\_on\_container\_copy\_assignment... \>::type **propagate\_on\_container\_copy\_assignment**\
 typedef \_\_or\_\< typename\_\_traits::propagate\_on\_container\_move\_assignment, typenameallocator\_traits\< \_InnerAllocs \>::propagate\_on\_container\_move\_assignment... \>::type **propagate\_on\_container\_move\_assignment**\
 typedef \_\_or\_\< typename\_\_traits::propagate\_on\_container\_swap, typenameallocator\_traits\< \_InnerAllocs \>::propagate\_on\_container\_swap... \>::type **propagate\_on\_container\_swap**\
 typedef **\_\_traits::size\_type** **size\_type**\
 typedef **\_\_traits::value\_type** **value\_type**\
 typedef **\_\_traits::void\_pointer** **void\_pointer**\

### Public Member Functions

template\<typename \_Outer2, typename = \_Constructible\<\_Outer2\>\> **scoped\_allocator\_adaptor** (\_Outer2 &&\_\_outer, const \_InnerAllocs &... \_\_inner) noexcept\
 **scoped\_allocator\_adaptor** (const scoped\_allocator\_adaptor &\_\_other) noexcept\
 template\<typename \_Outer2, typename = \_Constructible\<const \_Outer2&\>\> **scoped\_allocator\_adaptor** (const scoped\_allocator\_adaptor\< \_Outer2, \_InnerAllocs... \> &\_\_other) noexcept\
 **scoped\_allocator\_adaptor** (scoped\_allocator\_adaptor &&\_\_other) noexcept\
 template\<typename \_Outer2, typename = \_Constructible\<\_Outer2\>\> **scoped\_allocator\_adaptor** (scoped\_allocator\_adaptor\< \_Outer2, \_InnerAllocs... \> &&\_\_other) noexcept\
 pointer **allocate** (size\_type \_\_n)\
 pointer **allocate** (size\_type \_\_n, const\_void\_pointer \_\_hint)\
 template\<typename \_Tp, typename... \_Args\> void **construct** (\_Tp \*\_\_p, \_Args &&... \_\_args)\
 void **deallocate** (pointer \_\_p, size\_type \_\_n) noexcept\
 template\<typename \_Tp\> void **destroy** (\_Tp \*\_\_p)\
 const inner\_allocator\_type & **inner\_allocator** () const noexcept\
 inner\_allocator\_type & **inner\_allocator** () noexcept\
 size\_type **max\_size** () const\
 scoped\_allocator\_adaptor & **operator=** (const scoped\_allocator\_adaptor &)=default\
 scoped\_allocator\_adaptor & **operator=** (scoped\_allocator\_adaptor &&)=default\
 const outer\_allocator\_type & **outer\_allocator** () const noexcept\
 outer\_allocator\_type & **outer\_allocator** () noexcept\
 scoped\_allocator\_adaptor **select\_on\_container\_copy\_construction** () const\

### Friends

template\<typename...\> struct **\_\_inner\_type\_impl**\
 template\<typename \_OutA1, typename \_OutA2, typename... \_InA\> bool **operator==** (const scoped\_allocator\_adaptor\< \_OutA1, \_InA... \> &\_\_a, const scoped\_allocator\_adaptor\< \_OutA2, \_InA... \> &\_\_b) noexcept\

### Related Symbols

(Note that these are not member symbols.)  template\<typename \_OutA1, typename \_OutA2, typename... \_InA\> bool **operator==** (const scoped\_allocator\_adaptor\< \_OutA1, \_InA... \> &\_\_a, const scoped\_allocator\_adaptor\< \_OutA2, \_InA... \> &\_\_b) noexcept\

## Detailed Description

### template\<typename \_OuterAlloc, typename... \_InnerAllocs\>

class std::scoped\_allocator\_adaptor\< \_OuterAlloc, \_InnerAllocs \>"An adaptor to recursively pass an allocator to the objects it constructs.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
