---
name: "std::experimental::propagate_const"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::experimental::propagate_const/3cxx"
---

# std::experimental::propagate\_const(3cxx)

Const-propagating wrapper.

## NAME

std::experimental::propagate\_const\< \_Tp \> - Const-propagating wrapper.

## SYNOPSIS

`#include <propagate_const>`

### Public Types

**typedef** **remove\_reference\_t**\< **decltype**(\***std::declval**\< \_Tp & \>())\> **element\_type**\

### Public Member Functions

template\<**typename** \_Up , **typename** **enable\_if**\< \_\_and\_\< **is\_constructible**\< \_Tp, \_Up && \>, **is\_convertible**\< \_Up &&, \_Tp \>, \_\_not\_\< \_\_is\_propagate\_const\< **typename** **decay**\< \_Up \>::type \> \> \>::value, bool \>::type  = true\> constexpr **propagate\_const** (\_Up &&**\_\_u**)\
 template\<**typename** \_Up , **typename** **enable\_if**\< \_\_and\_\< **is\_constructible**\< \_Tp, \_Up && \>, \_\_not\_\< **is\_convertible**\< \_Up &&, \_Tp \> \>, \_\_not\_\< \_\_is\_propagate\_const\< **typename** **decay**\< \_Up \>::type \> \> \>::value, bool \>::type  = false\> constexpr **propagate\_const** (\_Up &&**\_\_u**)\
 **propagate\_const** (const **propagate\_const** &\_\_p)=**delete**\
 constexpr **propagate\_const** (**propagate\_const** &&\_\_p)=**default**\
 template\<**typename** \_Up , **typename** **enable\_if**\< \_\_and\_\< **is\_constructible**\< \_Tp, \_Up && \>, **is\_convertible**\< \_Up &&, \_Tp \> \>::value, bool \>::type  = true\> constexpr **propagate\_const** (**propagate\_const**\< \_Up \> &&**\_\_pu**)\
 template\<**typename** \_Up , **typename** **enable\_if**\< \_\_and\_\< **is\_constructible**\< \_Tp, \_Up && \>, \_\_not\_\< **is\_convertible**\< \_Up &&, \_Tp \> \> \>::value, bool \>::type  = false\> constexpr **propagate\_const** (**propagate\_const**\< \_Up \> &&**\_\_pu**)\
 constexpr **element\_type** \* **get** ()\
 constexpr const **element\_type** \* **get** () const\
 constexpr **operator bool** () const\
 template\<**typename** \_Up  = \_Tp, **typename** **enable\_if**\< \_\_or\_\< **is\_pointer**\< \_Up \>, **is\_convertible**\< \_Up, const **element\_type** \* \> \>::value, bool \>::type  = true\> constexpr **operator const element\_type \*** () const\
 template\<**typename** \_Up  = \_Tp, **typename** **enable\_if**\< \_\_or\_\< **is\_pointer**\< \_Up \>, **is\_convertible**\< \_Up, const **element\_type** \* \> \>::value, bool \>::type  = true\> constexpr **operator element\_type \*** ()\
 constexpr **element\_type** & **operator\*** ()\
 constexpr const **element\_type** & **operator\*** () const\
 constexpr **element\_type** \* **operator-\>** ()\
 constexpr const **element\_type** \* **operator-\>** () const\
 template\<**typename** \_Up , **typename**  = typename enable\_if\<\_\_and\_\<is\_convertible\<\_Up&&, \_Tp\>,					  \_\_not\_\<\_\_is\_propagate\_const\<						   typename decay\<\_Up\>::type\>\>					  \>::value\>::type\> constexpr **propagate\_const** & **operator=** (\_Up &&**\_\_u**)\
 **propagate\_const** & **operator=** (const **propagate\_const** &\_\_p)=**delete**\
 constexpr **propagate\_const** & **operator=** (**propagate\_const** &&\_\_p)=**default**\
 template\<**typename** \_Up , **typename**  = typename enable\_if\<is\_convertible\<\_Up&&, \_Tp\>::value\>::type\> constexpr **propagate\_const** & **operator=** (**propagate\_const**\< \_Up \> &&**\_\_pu**)\
 constexpr **void** **swap** (**propagate\_const** &**\_\_pt**) noexcept(**\_\_is\_nothrow\_swappable**\< \_Tp \>::value)\

### Friends

template\<**typename** \_Up \> constexpr const \_Up & **get\_underlying** (const **propagate\_const**\< \_Up \> &**\_\_pt**) noexcept\
 template\<**typename** \_Up \> constexpr \_Up & **get\_underlying** (**propagate\_const**\< \_Up \> &**\_\_pt**) noexcept\

## Detailed Description

### template\<typename \_Tp\>

class std::experimental::propagate\_const\< \_Tp \>"Const-propagating wrapper.

## Author

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