Clarify the support of constexpr

This commit is contained in:
Christophe Riccio
2018-08-27 20:19:19 +02:00
parent bde7af55b1
commit 2fdc2dc748
3 changed files with 9 additions and 4 deletions

View File

@@ -390,12 +390,14 @@ For example, if a program is compiled with Visual Studio using `/arch:AVX`, GLM
Its possible to avoid the instruction set detection by forcing the use of a specific instruction set with one of the fallowing define:
`GLM_FORCE_SSE2`, `GLM_FORCE_SSE3`, `GLM_FORCE_SSSE3`, `GLM_FORCE_SSE41`, `GLM_FORCE_SSE42`, `GLM_FORCE_AVX`, `GLM_FORCE_AVX2` or `GLM_FORCE_AVX512`.
The use of intrinsic functions by GLM implementation can be avoided using the define `GLM_FORCE_PURE` before any inclusion of GLM headers.
The use of intrinsic functions by GLM implementation can be avoided using the define `GLM_FORCE_PURE` before any inclusion of GLM headers. This can be particularly useful if we want to rely on C++14 `constexpr`.
```cpp
#define GLM_FORCE_PURE
#include <glm/glm.hpp>
static_assert(glm::vec4::length() == 4, "Using GLM C++ 14 constexpr support for compile time tests");
// GLM code will be compiled using pure C++ code without any intrinsics
```