Say that I have.. int, int*, int**, etc. Can I use std::remove_pointer or similar to get straight to type int? Thanks
To get the value pointed to by a pointer, you need to use the dereferencing operator * (e.g., if pNumber is a int pointer, *pNumber returns the value pointed to by pNumber . It is called dereferencing or indirection).
Pointers (C++) A pointer is a variable that stores the memory address of an object. Pointers are used extensively in both C and C++ for three main purposes: to allocate new objects on the heap, to pass functions to other functions.
Yuppers.
template<typename T> struct remove_all {
typedef T type;
};
template<typename T> struct remove_all<T*> {
typedef typename remove_all<T>::type type;
};
std::remove_pointer
itself isn't of that much use here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With