A<T> is not derived from B<T>
Axel Freyn
axel-freyn@gmx.de
Fri Mar 11 17:32:00 GMT 2011
Hi Kai,
On Fri, Mar 11, 2011 at 05:35:10PM +0100, SPUeNTRUP - Kai Henningsen wrote:
> ... or more precisely,
> error: type âaccessor_parameter<T, (sizeof (T) > sizeof (T*))>â is not derived from type âC3Variable<T>â
Well, it means that the first type is NOT derived from the second.
But you do something which is only valid IF the first would be derived
from the second (maybe: convert a Pointer to the first type to a pointer
of the second? or create a Reference of second's type to an object of
the first type?)
In order to say more, I (and probably also most others on the list)
would need a minimal example which creates the problem...
>
> [...]
> Oh, just in case it matters:
>
> template < class C, bool > struct accessor_parameter {
> };
> template <> template < class C > struct accessor_parameter <C, true > {
> typedef const C & type;
> };
> template <> template < class C > struct accessor_parameter <C, false > {
> typedef C type;
> };
> # define accessor_pt(T) \
> accessor_parameter < T, (sizeof(T) > sizeof(T *)) >::type
This confirms the statement of the compiler ;-)
At least these specializations of "accessor_parameter" are clearly NOT
derived from C3Variable<T>....
If you check the line where g++ reported the error: do you convert there
an "accessor_parameter<T, (sizeof (T) > sizeof (T*))>" to a reference
C3Variable<T>?
Axel
More information about the Gcc-help
mailing list