ForgottenCat's blog

By ForgottenCat, history, 3 months ago, In English

I use vector::assign_range, and CE. Also happens on append_range (using C++23). Is the compiler outdated? If so, plz update.

  • Vote: I like it
  • +8
  • Vote: I do not like it

»
3 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by ForgottenCat (previous revision, new revision, compare).

»
3 months ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

So C++ has something called feature testing. Basically, when GCC say implements C++23, there is no clear guarantee that they implement the whole of the standard. So, when something is implemented (at least as of C++20 I believe), there will be a corresponding flag enabled.

In this case, assign_range has the __cpp_lib_containers_ranges feature test macro, and as per the example they provide there, you can check whether or not that macro is actually present or not (I tested and it's not present on codeforces as you might expect).

So as you said, most likely G++ 14.2 with C++23 [msys2, 64bit] just hasn't implemented that feature yet...