Re: A<T> is not derived from B<T>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux