cocos / engine-native

Native engine for Cocos Creator v2.x

Home Page:http://www.cocos.com/en/products

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use a consistent convention for throwing-functions and error-handling that's independed of compiler.

Jacksparrow2525 opened this issue · comments

For example in FrameGraph's implementation;

Resource() noexcept = default;

Was causing issues, between different GCC and Clang.
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1778
Some compilers deal with the quirks some not.

A tempororary Kludge was to remove the noexept qualifier in VS2017,
but the member making the class thowing should be identified and correctly handled

Insight:
https://stackoverflow.com/questions/29483120/program-with-noexcept-constructor-accepted-by-gcc-rejected-by-clang

According the goole's coding style of noexcept, i think we'd better only use it in move constructors and the functions that will improve performance.