void foo (void *p); // library function; can't edit
template<typename T>
void Remove (T *p)
{
// main code
foo(p); // Can we remove const ness of T here ?
}
I have multiple functions like Remove(), it can be called with const T* also, which will not match with foo(void*). Without overloading/specializing Remove() can I remove the constness of T*? … Usage:
const int *p;
Remove(p); // error related to `foo()`
If you really need it, there’s a boost/C++0x metafunction for that:
test: https://ideone.com/L6urU