1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
// remove_const example
#include <iostream>
#include <type_traits>
int main() {
typedef const char cc;
std::remove_const<cc>::type a; // char a
std::remove_const<const char*>::type b; // const char* b
std::remove_const<char* const>::type c; // char* c
a = 'x';
b = "remove_const";
c = new char[10];
std::cout << b << std::endl;
return 0;
}
|