• 0 Posts
  • 4 Comments
Joined 9 months ago
cake
Cake day: December 24th, 2023

help-circle



  • I am trying C++ for this year’s advent of code. The most asinine thing i encountered is that the bracket operator on std::map writes 0 value if the key is not found. So your code doesn’t compile if you declare a const map or a const map reference as a function parameter. Compiler fails with “discards const qualifier on argument”.

    I mean, wtf?

    Edit: this is probably true for other STL containers