educative.io

VS C++ IDE dislikes your example code

std::ranges::views::iota_view();
std::ranges::views::iota();
for (int i : std::views::iota(0, 10)) vec.push_back(i);

I am using VS C++ and have set my compiler to C++20 (Debug & Release) with /permissive Conformance mode.
None of the above compiles. The IDE underlines them with red! I can navigate to the items in the ranges header but for some reason the IDE dislikes it.
What are you using to compile your code?
Do you know how I get get round this problem?

Microsoft Visual Studio Community 2022 (64-bit)
Version 17.0.5

Thanks,
Joseph


Course: The All-in-One Guide to C++20 - Learn Interactively
Lesson: Lazy Evaluation - The All-in-One Guide to C++20

Hi @Joseph_Codadeen

My name is Shahrukh Naeem. I hope everything is going well with you. Thank you for reaching out about this.

Kindly read and follow all the following instructions.

Secondly, go through this link as well.

I hope that this guide is helpful. Remember that I am always available via message to help you with any difficulty you might encounter.

Regards,

Happy Learning :slight_smile:

MSVC /std:c++latest worked, thank you :slight_smile:

Hi @Joseph_Codadeen

You are most welcome. I’m glad I could be a help to you. Hope you have a nice day.
Happy Learning! :slight_smile:

Kind Regards,
Shahrukh Naeem.