Cuberite Forum

Full Version: Using c++11 constexpr
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm doing something that could benefit from c++11 constexpr and since there is currently no use of the feature yet I wanted to make sure it's okay to use them as documented in the contributing.md file.

constexpr allows us to define function that can be run at compile time or run-time. When an argument of a constexpr is a constexpr itself (a constant or constexpr function) the compiler will instead insert the result of the function call directly. I thinks this is something we should take advantage of.

http://www.cprogramming.com/c++11/c++11-...texpr.html

VS2013 doesn't have support for constexpr so I guess this will have to wait :/