- 论坛徽章:
- 0
|
class a
{
public:
struct timeItpair;
typedef std::map<key,timeItpair,ltkey> LKMAP;
LKMAP lookupMap;
typedef std::multimap<const time_t,LKMAP::iterator> REVERSE_LKMAP;
REVERSE_LKMAP reverse_lkMap;
struct timeItpair
{
time_t t;
REVERSE_LKMAP::iterator it;
timeItpair (const timeItpair& target)
{
t=target.t;
it= target.it;
}
timeItpair ()
{
}
};
};
上述代码在GCC 3.3.3 linux上可以编过并能运行, 但在hp-unix上用aCC 就提示
Error 239: "/opt/aCC/include/../include/utility", line 101 # A class/union shall not contain a member with incomplete type.
T2 second;
^^^^^^
Error 537: "/opt/aCC/include/../include/utility", line 101 # Cannot create a 'timeItpair' object; struct timeItpair has only been seen as an incomplete declaration.
T2 second;
^^^^^^
为这事头疼了一天多了,有没有人遇到过这种问题,虽然有点前向声明的意思,但为啥gcc上就能过呢,谢谢 |
|