Is it possible to use std :: remove_pointer to remove all indirect indications from a pointer type?

Say what I have .. int, int *, int ** etc. Can I use std :: remove_pointer or similarly to get a direct int type? Thanks

+4
source share
1 answer

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 alone is not so useful here.

+9
source

Source: https://habr.com/ru/post/1489194/


All Articles