Support For C++20 Ranges In VS Is Now Available

VS 2019 version 16.6 brings the first user-visible pieces of C++20 Ranges support.

Microsoft announced the C++20 Ranges support in Visual Studio 2019 version 16.6.
 
Microsoft said that it has been working on support machinery for a few releases now, but with this release, there are now some tools available for users.
 
Well, implementation of the Ranges critically relies on C++ principles and as such is usable in their C++20 Preview modes for both MSVC and Clang.
 
The standard library concepts in <concepts> have already been shipping in Visual Studio since version 16.3. This includes the customization point std::ranges::swap, which is like a smarter std::swap that does “the using bit” for you.
 
The first batch of Range algorithms in <algorithm> includes: 
  • copy, copy_n, and copy_if
  • all_of, any_of, and none_of
  • equal and mismatch
  • count and count_if
  • find, find_if, and find_if_not
  • for_each and for_each_n
Also, currently in Preview, VS 2019 version 16.7 is bringing more components of Ranges for you such as Algorithms find_end, find_first_of, and adjacent_find; Updates to reverse_iterator and move_iterator to better adapt “new” Ranges iterator types, including the addition of move_sentinel; and the subrange class template, which aggregates an iterator and sentinel into a convenient range object.
 
For additional details, you can visit the official blog here.