I want to know if a type is a pointer during execution.
I know the mechanism to use is partial specialization, I have found this source code :
It compiles and works successfully with GNU g++.
But MS' C++ compiler can't compile this code (I have Visual Studio C++ 6).
I also know the boost library has already the facility I want. I have looked at the source code but I was not able to understand how it is handled with VC6.
Does someone know the trick?
--
Globos
I know the mechanism to use is partial specialization, I have found this source code :
Code:
#include <assert.h>
#include <iostream>
using namespace std;
template<class G>
struct is_pointer_type
{
static const bool value = false;
};
template<class G>
struct is_pointer_type<G*>
{
static const bool value = true;
};
int main ()
{
assert (!is_pointer_type<int>::value);
assert (is_pointer_type<int*>::value);
assert (is_pointer_type<int**>::value);
return 0;
}
But MS' C++ compiler can't compile this code (I have Visual Studio C++ 6).
I also know the boost library has already the facility I want. I have looked at the source code but I was not able to understand how it is handled with VC6.
Does someone know the trick?
--
Globos