CARVIEW |
Select Language
HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Wed, 23 Jul 2025 20:08:35 GMT
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Location: /reference/type_traits/remove_cv/
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 23 Jul 2025 20:08:35 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
ETag: W/"ba28-AnTzh7DVOvdp1huKYuAm6ge31vY"
Content-Encoding: gzip
Obtains the type T without any top-level const or volatile qualification.
The transformed type is aliased as member type remove_cv::type.
If T is cv-qualified (either const and/or volatile), this is the same type as T but with its cv-qualification removed. Otherwise, it is T unchanged.
Notice that this class merely obtains a type using another type as model, but it does not transform values or objects between those types. To explicitly remove the cv-qualifier of an object, const_cast can be used.
Output:
Reference
C library:
- <cassert> (assert.h)
- <cctype> (ctype.h)
- <cerrno> (errno.h)
-
<cfenv> (fenv.h)C++11
- <cfloat> (float.h)
-
<cinttypes> (inttypes.h)C++11
- <ciso646> (iso646.h)
- <climits> (limits.h)
- <clocale> (locale.h)
- <cmath> (math.h)
- <csetjmp> (setjmp.h)
- <csignal> (signal.h)
- <cstdarg> (stdarg.h)
-
<cstdbool> (stdbool.h)C++11
- <cstddef> (stddef.h)
-
<cstdint> (stdint.h)C++11
- <cstdio> (stdio.h)
- <cstdlib> (stdlib.h)
- <cstring> (string.h)
-
<ctgmath> (tgmath.h)C++11
- <ctime> (time.h)
-
<cuchar> (uchar.h)C++11
- <cwchar> (wchar.h)
- <cwctype> (wctype.h)
Containers:
-
<array>C++11
- <deque>
-
<forward_list>C++11
- <list>
- <map>
- <queue>
- <set>
- <stack>
-
<unordered_map>C++11
-
<unordered_set>C++11
- <vector>
-
Input/Output:
Multi-threading:
-
<atomic>C++11
-
<condition_variable>C++11
-
<future>C++11
-
<mutex>C++11
-
<thread>C++11
-
Other:
- <algorithm>
- <bitset>
-
<chrono>C++11
-
<codecvt>C++11
- <complex>
- <exception>
- <functional>
-
<initializer_list>C++11
- <iterator>
- <limits>
- <locale>
- <memory>
- <new>
- <numeric>
-
<random>C++11
-
<ratio>C++11
-
<regex>C++11
- <stdexcept>
- <string>
-
<system_error>C++11
-
<tuple>C++11
-
<type_traits>C++11
-
<typeindex>C++11
- <typeinfo>
- <utility>
- <valarray>
<type_traits>
helper classes
-
false_typeC++11
-
integral_constantC++11
-
true_typeC++11
-
type traits
-
alignment_ofC++11
-
extentC++11
-
has_virtual_destructorC++11
-
is_abstractC++11
-
is_arithmeticC++11
-
is_arrayC++11
-
is_assignableC++11
-
is_base_ofC++11
-
is_classC++11
-
is_compoundC++11
-
is_constC++11
-
is_constructibleC++11
-
is_convertibleC++11
-
is_copy_assignableC++11
-
is_copy_constructibleC++11
-
is_default_constructibleC++11
-
is_destructibleC++11
-
is_emptyC++11
-
is_enumC++11
-
is_floating_pointC++11
-
is_functionC++11
-
is_fundamentalC++11
-
is_integralC++11
-
is_literal_typeC++11
-
is_lvalue_referenceC++11
-
is_member_function_pointerC++11
-
is_member_object_pointerC++11
-
is_member_pointerC++11
-
is_move_assignableC++11
-
is_move_constructibleC++11
-
is_nothrow_assignableC++11
-
is_nothrow_constructibleC++11
-
is_nothrow_copy_assignableC++11
-
is_nothrow_copy_constructibleC++11
-
is_nothrow_default_constructibleC++11
-
is_nothrow_destructibleC++11
-
is_nothrow_move_assignableC++11
-
is_nothrow_move_constructibleC++11
-
is_null_pointerC++14
-
is_objectC++11
-
is_podC++11
-
is_pointerC++11
-
is_polymorphicC++11
-
is_referenceC++11
-
is_rvalue_referenceC++11
-
is_sameC++11
-
is_scalarC++11
-
is_signedC++11
-
is_standard_layoutC++11
-
is_trivialC++11
-
is_trivially_assignableC++11
-
is_trivially_constructibleC++11
-
is_trivially_copy_assignableC++11
-
is_trivially_copy_constructibleC++11
-
is_trivially_copyableC++11
-
is_trivially_default_constructibleC++11
-
is_trivially_destructibleC++11
-
is_trivially_move_assignableC++11
-
is_trivially_move_constructibleC++11
-
is_unionC++11
-
is_unsignedC++11
-
is_voidC++11
-
is_volatileC++11
-
rankC++11
-
type transformations
-
add_constC++11
-
add_cvC++11
-
add_lvalue_referenceC++11
-
add_pointerC++11
-
add_rvalue_referenceC++11
-
add_volatileC++11
-
aligned_storageC++11
-
aligned_unionC++11
-
common_typeC++11
-
conditionalC++11
-
decayC++11
-
enable_ifC++11
-
make_signedC++11
-
make_unsignedC++11
-
remove_all_extentsC++11
-
remove_constC++11
-
remove_cvC++11
-
remove_extentC++11
-
remove_pointerC++11
-
remove_referenceC++11
-
remove_volatileC++11
-
result_ofC++11
-
underlying_typeC++11
-
- Reference
- <type_traits>
- remove_cv
class template
<type_traits>
std::remove_cv
template <class T> struct remove_cv;
Remove cv qualification
The transformed type is aliased as member type remove_cv::type.
If T is cv-qualified (either const and/or volatile), this is the same type as T but with its cv-qualification removed. Otherwise, it is T unchanged.
Notice that this class merely obtains a type using another type as model, but it does not transform values or objects between those types. To explicitly remove the cv-qualifier of an object, const_cast can be used.
Template parameters
- T
- A type.
Member types
member type | definition |
---|---|
type | If T is cv-qualified, the same type as T but with any cv-qualification removed. Otherwise, T |
Example
|
|
Output:
type of a is not const type of a is not volatile |
See also
- add_cv
- Add const volatile qualification (class template)
- remove_const
- Remove const qualification (class template)
- remove_volatile
- Remove volatile qualification (class template)
- remove_reference
- Remove reference (class template)
- remove_pointer
- Remove pointer (class template)
Home page | Privacy policy
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us
© cplusplus.com, 2000-2025 - All rights reserved - v3.3.4s
Spotted an error? contact us