Mam problem z ustawieniem standardu w VS Code dostaję taki błąd wpisując komendę: -std=c++17 w terminalu. Dodam ,że jest kod z tutoriala https://www.learncpp.com/
wersja gcc: gcc (GCC) 9.2.0 Dodałem Mingw-w64 do ścieżki. W czym leży problem?
-std=c++17 : The term '-std=c++17' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
- -std=c++17
-
+ CategoryInfo : ObjectNotFound: (-std=c++17:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
#include <array>
#include <iostream>
#include <string_view>
#include <tuple>
#include <type_traits>
namespace a::b::c
{
inline constexpr std::string_view str{ "hello" };
}
template <class... T>
std::tuple<std::size_t, std::common_type_t<T...>> sum(T... args)
{
return { sizeof...(T), (args + ...) };
}
//--------------------------------------------------------------------------
int main()
{
auto [iNumbers, iSum]{ sum(1, 2, 3) };
std::cout << a::b::c::str << ' ' << iNumbers << ' ' << iSum << '\n';
std::array arr{ 1, 2, 3 };
std::cout << std::size(arr) << '\n';
return 0;
}