Intermediate results using expression templates

只愿长相守 提交于 2019-11-29 07:56:22

For now, you can always use BOOST_AUTO() in the place of C++0x's auto keyword to get intermediate results more easily.

Matrix x, y;
BOOST_AUTO(result, (x + y) * (x + y)); // or whatever.
Motti

I don't understand your question. auto is going to be reused in C++0x for automatic type inference.

I personally see this as a drawback for expression templates since they often relay on having a smaller life span than the objects they are built upon which can turn out to be false if the expression template is captured as I explain here.

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