language-lawyer 532

  1. C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?
  2. In CSS Flexbox, why are there no “justify-items” and “justify-self” properties?
  3. int a[] = {1,2,}; Weird comma allowed. Any particular reason?
  4. Can C++ code be valid in both C++03 and C++11 but do different things?
  5. Why is f(i = -1, i = -1) undefined behavior?
  6. A positive lambda: '+[]{}' - What sorcery is this?
  7. Valid, but worthless syntax in switch-case?
  8. What made i = i++ + 1; legal in C++17?
  9. Is the operation “false < true” well defined?
  10. Copy/move assignment in std::vector::erase() and std::deque::erase()
  11. Does C++11, 14, 17 or 20 introduce a standard constant for pi?
  12. Definition of “==” operator for Double
  13. Is it safe to push_back an element from the same vector?
  14. Lambda capture and parameter with same name - who shadows the other? (clang vs gcc)
  15. Program being compiled differently in 3 major C++ compilers. Which one is right?
  16. Why does the ternary operator with commas evaluate only one expression in the true case?
  17. Is passing a C++ object into its own constructor legal?
  18. When does invoking a member function on a null instance result in undefined behavior?
  19. Is “else if” a single keyword?
  20. When using C headers in C++, should we use functions from std:: or the global namespace?
  21. How can a program with a global variable called main instead of a main function work?
  22. Printing null pointers with %p is undefined behavior?
  23. Does this code from “The C++ Programming Language” 4th edition section 36.3.6 have well-defined behavior?
  24. Is this a known pitfall of C++11 for loops?
  25. Accessing inactive union member and undefined behavior?
  26. Does “Undefined Behavior” really permit *anything* to happen?
  27. Error when using in-class initialization of non-static data member and nested class constructor
  28. When is a private constructor not a private constructor?
  29. Why are references not “const” in C++?
  30. When do extra parentheses have an effect, other than on operator precedence?
  31. Why are async state machines classes (and not structs) in Roslyn?
  32. What is “callback hell” and how and why RX solves it?
  33. Different cast operator called by different compilers
  34. Why is 019 not a JavaScript syntax error? Or why is 019 > 020
  35. Can branches with undefined behavior be assumed unreachable and optimized as dead code?
  36. Efficient unsigned-to-signed cast avoiding implementation-defined behavior
  37. How can this structure have sizeof == 0?
  38. Different behaviour of comma operator in C++ with return?
  39. Is a pointer with the right address and type still always a valid pointer since C++17?
  40. Type of `this` in static member function?
  41. Is null reference possible?


  42. Is it legal to compare dangling pointers?
  43. Take the address of a one-past-the-end array element via subscript: legal by the C++ Standard or not?
  44. Can argc be zero on a POSIX system?
  45. Could a C++ implementation, in theory, parallelise the evaluation of two function arguments?
  46. Is masking before unsigned left shift in C/C++ too paranoid?
  47. De Morgan's Law optimization with overloaded operators
  48. Could it be the case that sizeof(T*) != sizeof(const T*)?
  49. Is it guaranteed to be safe to perform memcpy(0,0,0)?
  50. Why is a double semicolon a SyntaxError in Python?