PPC: problems with C++ templates

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PPC: problems with C++ templates

510 Views
bob_ubi
Contributor I

Hi All,

 

I am trying to cross-compile an application that uses std::tr1::tuple. I have this declaration in std::tr1 namespace:

 

 

template <int k, typename T0>

 

class tuple<T0> {...}

 

template <int k, typename T0> MyType

 

 

get(const tuple<T0>& t) {...}

 

When I tested with this code:

 

tuple<int> t;

int N = 1;

...

r = get<N-1>(t);

 

 

I got an error from mwcceppc.exe like what it cannot find get because it is looking for this:

 

get<0, tuple<int, std::tr1::nat, std::tr1::nat, ...>>(const tuple<int, std::tr1::nat, std::tr1::nat, ...>&)

 

I was expecting this instead:

 

get<0, tuple<int>>(const tuple<int>&)

 

I am wondering where is this padding std::tr1::nat come from? Could I tell the compiler to not insert the padding?

 

Your help is appreciated.

 

This case is compiled well with MSDEV-2008. mwcceppc.exe -version gave

 

Freescale C/C++ Compiler for Embedded PowerPC.
Copyright (c) 2007, Freescale Semiconductor, Inc.
All rights reserved.
Version 4.3 build 145
Runtime Built: Oct  9 2008 05:39:23

 

Robert Le Van Mao

Ubisoft - Montreal

Labels (1)
0 Kudos
3 Replies

319 Views
J2MEJediMaster
Specialist I

First, unless there is a compelling reason NOT to, I would update to a later (higher version) of CodeWarrior. Second, it seems like you need the big guns for this issue, so I would file an on-line service request. Click here to go to the service request page. For Topic choose Software Product Support, and for Category choose CodeWarrior. Be prepared to give them a section of code that reproduces the problem.

 

---Tom

0 Kudos

319 Views
bob_ubi
Contributor I

Hi Tom,

 

Thanks for the reply. Because of XYZ- third-party issues, the version of the compiler is imposed on me :smileysad:

But I am eager to hear solutions from you. 

 

Robert 

0 Kudos

319 Views
J2MEJediMaster
Specialist I

At this point, file a service request, unless someone knowledgeable in C++ in the forums posts a solution.

 

---Tom

0 Kudos