Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 1.25 KB

remove-cv-class.md

File metadata and controls

64 lines (45 loc) · 1.25 KB
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: remove_cv Class
remove_cv Class
11/04/2016
type_traits/std::remove_cv
remove_cv class
remove_cv
8502602a-1c80-479c-84e0-33bd1d6496d6

remove_cv Class

Makes non const/volatile type from type.

Syntax

template <class T>
struct remove_cv;

template <class T>
using remove_cv_t = typename remove_cv<T>::type;

Parameters

T
The type to modify.

Remarks

An instance of remove_cv<T> holds a modified-type that is T1 when T is of the form const T1, volatile T1, or const volatile T1, otherwise T.

Example

#include <type_traits>
#include <iostream>

int main()
    {
    int *p = (std::remove_cv_t<const volatile int> *)0;

    p = p;  // to quiet "unused" warning
    std::cout << "remove_cv_t<const volatile int> == "
        << typeid(*p).name() << std::endl;

    return (0);
    }
remove_cv_t<const volatile int> == int

Requirements

Header: <type_traits>

Namespace: std

See also

<type_traits>
remove_const Class
remove_volatile Class