Udostępnij za pośrednictwem


add_cv — Klasa

Tworzy typ const/volatile z typu.

template<class Ty>
    struct add_cv;

template<class T>
using add_cv_t = typename add_cv<T>::type;

Parametry

  • Ty
    Typ do modyfikacji.

Uwagi

Wystąpienie modyfikatora typu przechowuje zmodyfikowany typ add_volatile — Klasa< add_const — Klasa<Ty> >.

Przykład

 

#include <type_traits> 
#include <iostream> 
 
int main() 
    { 
    std::add_cv_t<int> *p = (const volatile int *)0; 
 
    p = p;  // to quiet "unused" warning 
    std::cout << "add_cv<int> == " 
        << typeid(*p).name() << std::endl; 
 
    return (0); 
    } 
 
  

Wymagania

Nagłówek: <type_traits>

Przestrzeń nazw: std

Zobacz też

Informacje

<type_traits>

remove_const — Klasa

remove_volatile — Klasa

Inne zasoby

<type_traits> Członkowie