Am I right to interpret unsigned int{};
as zero-initialization of a temporary unsigned int
without a name in the contexts provided below? The example does not work with clang or gcc, but compiles fine in Visual Studio: https://godbolt.org/z/LYWCCN
int ifun(int value) {
return value * 10;
}
unsigned int uifun(unsigned int value) {
return value * 10u;
}
int main() {
// does not work in gcc and clang
unsigned int{};
unsigned int ui = uifun(unsigned int{});
// works with all three compilers, also unsigned{}; works
int{};
int i = ifun(int{});
}