Generic code received a T that may be a pointer, a pointer to a pointer, or deeper — and it needs the element type at the bottom. One remove_pointer is not enough and you do not know the depth in advance. Type recursion solves this in three lines.
Implement RemoveAllPointers<T>::type: int*** becomes int, int* becomes int, int stays int. std::remove_pointer strips one level — yours strips them all.
The primary template is the recursion base: a non-pointer maps to itself. The T* specialization is the step.
Inside the T* specialization, ask RemoveAllPointers<T> again — typename is required before its ::type.
Hit Submit (or ⌘/Ctrl + ↵) — test results will show up here.