VS2022 configures C++ 20 to solve import std error

The new feature of C++ 20 supports using import std to import the std module, as follows:

There are two main steps in configuration:

(1) Project--Properties--General--C++ Language Standard--Preview-Features in the latest C++ working draft (/std:c++latest)< /span>

Note that selecting the ISO C++20 standard (/std:c++20) will not work properly. Be sure to select c++ latest.

(2) Project--Properties--C/C++--Language--Generate ISO C++23 standard library module--Yes 

After completing the above two steps, you can use the import std code normally and run successfully!

 

Guess you like

Origin blog.csdn.net/stq054188/article/details/135000933