L
Levent
Hi,
Is there a generic way to dereference a pointer (of any order) enough
to get the underlying type that the whole thing points to?
Consider,
template <class P>
class Foo {
typename THIS_IS_THE_WAY_TO_DO_IT(P) member;
};
such that, say, for the following instantiation of the template class Foo,
Foo<int******> f;
f.member will be an int.
FWIW, I currently achieve this with specialization:
template <class P>
class Foo<P*> {
P member;
};
template <class P>
class Foo<P**> {
P member;
};
template <class P>
class Foo<P***> {
P member;
};
an so forth, which is not cool
Is there a generic way to dereference a pointer (of any order) enough
to get the underlying type that the whole thing points to?
Consider,
template <class P>
class Foo {
typename THIS_IS_THE_WAY_TO_DO_IT(P) member;
};
such that, say, for the following instantiation of the template class Foo,
Foo<int******> f;
f.member will be an int.
FWIW, I currently achieve this with specialization:
template <class P>
class Foo<P*> {
P member;
};
template <class P>
class Foo<P**> {
P member;
};
template <class P>
class Foo<P***> {
P member;
};
an so forth, which is not cool