Incorrect Error Message: identifier "concept" is undefined
#12156
-
If I put the following code into the vscode editor, it will notify me #include <concepts>
template<typename Num>
concept Numeric = std::is_arithmetic_v<Num>;
template<typename Num>
requires Numeric<Num>
double convert_f_to_c(Num temperature) {
return (temperature - 32) * 5 / 9;
}
|
Beta Was this translation helpful? Give feedback.
Answered by
sean-mcmanus
Mar 29, 2024
Replies: 1 comment 1 reply
-
@lemorage It works for me without errors. You need to set cppStandard to "c++20" or higher. Also, running the C/C++: Log Diagnostics command with test.cpp active should give more configuration info. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lemorage
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@lemorage It works for me without errors. You need to set cppStandard to "c++20" or higher. Also, running the C/C++: Log Diagnostics command with test.cpp active should give more configuration info.