C++ array creation problem specific to gcc 4.5

时间秒杀一切 提交于 2019-12-05 21:58:15
Pass** passes = new Pass*[10];

I think this will do it:

typedef Pass * PassPtr;
Pass **passes = new PassPtr[10];

I don't understand why you are trying to wrap it so much.

Pass** passes = new Pass*[10];

Does that not work?

The extraneous parentheses you are using is now making it seem to the compiler like you are passing a constructor of Pass a lambda as a parameter. Lambdas are a new addition in C++0x, which would be why this error only cropped up in the new compiler. You can fix it by using Pass** passes = new Pass*[10]; instead.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!