![]() #error "The standard library doesn't support std::string::contains()." In case of std::string::contains you can use in your file.cpp: #include ![]() If you want to use specific features anyway, you can use the feature test macros to ensure they are already supported. Note that your compiler compiler may not have full support for C++23 yet. If you use CMake you can set: set(CMAKE_CXX_STANDARD 23)Ī full CMakeLists.txt example that works with any compiler is: # set minimum CMake major and minor versionĪdd_executable(Tutorial file1.cpp file2.cpp) ![]() To compile your file in C++23 mode you can use: g++ -std=c++23 file.cpp You can test which version of GCC is installed by: g++ -version Check for feature support of compilers and standard libraries. std::string::contains requires C++23 and at least GCC 11. SOLUTION: Manual compile worked, so I looked what was my VS Code C++ build version, solution was to add "-std=c++23" in the "args" section on the tasks.json file txt file, counting the number of appearances. This program is about reading a file named romeoandjuliet.txt and the user types a word to see if it appears in the. I am currently learning about reading and writing files in C++, I use Visual Studio Code, and I have my c_cpp_properties.json set: "cppStandard": "c++23".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |