Consider a simple example:I would say it is a bug but both the latest [clang] and [gcc] accept the code so maybe I'm missing some relevant standard rule that makes the code valid?
The code doesn't compiled in clang, it produces the following diagnostic:MSVC crashed (according to godbolt) and gcc works fine. If a /= b is simply replaced by a = a / b then everybody accepts it. Why?
The code doesn't compiled by clang (error: constexpr variable 'z' must be initialized by a constant expression), msvc crashed (according to godbolt) and gcc works fine. If a /= b is simply replaced by a = a / b then everybody accepts it. Why? Who is right? Seems it's related...
Here's what I want to do; posting the whole code because it's not too long and also to demonstrate the specific task I'm trying to solve. Basically, I need a way to iterate values from parameter pack by index (the index part is important, even though it's not required in...
According to [this Q&A] since c++11 comma operator is constexpr capable. According to [this Q&A] constexpr variable should not be captured by lambda but should be usable inside its body.
I'm trying to implement a fast function dispatcher using compile time generated arrays to being able to use it at runtime in O(1).
Actually this "problem" feels extremely simple. While doing some calculated icon offsets, i came up with the following approach:
I am having trouble understanding why both gcc-8.2.0 and clang-7.0.0 reject the following code (live code here):
I have the following code where I am irritated by the fact that compiler is unable to see that variable passed as argument to a function is constexpr so I must use arity 0 function instead of 1 argument function.
I have this code where if you comment out the line commented "But this doesn't work?!" it compiles just fine, but if you don't, the compiler generates an error.