Surprise!
String literals make bad ranges
by Andrzej Krzemieński
From the article:
C++20 will come with what we call “Ranges” library. Meanwhile, range interface has been supported ever since C++11 in one context: range-based for loop. A range-based for loop can detect anything that is a range and work with it. In particular, it can work with string literals...
Add a Comment
Comments are closed.