It's not new that IntelliSense often lags behind C++ development.
For instance, the code below is valid in C++20, using the new Template String-Literal Operator feature.
template<typename C, size_t Size>
struct StrWrapper
{
std::array<C, Size> m_buf;
consteval StrWrapper(const C(&str)[Size]) : m_buf{}
{
std::copy(str, str + Size, m_buf.begin());
}
};
template <StrWrapper c>
consteval auto operator ""_wrap()
{
return c;
}
"hello world"_wrap;
But IntelliSense will report these errors:
E2500 a literal operator template must have a template parameter list equivalent to '<char ...>'
E2486 user-defined literal operator not found
I have found others who have the same problem, there are two reports on Developer Community, the earliest one is from Jan 2021, it's been nearly two years since.
It looks like Microsoft didn't want to solve the issue since this feature is somewhat not used often, and they're still struggling with the modules.
Is there any way to work around this? I've searched for a way to disable specific errors in IntelliSense but there seems to be none. Actually, there is one but it wouldn't help in this case since every single string that uses ""_wrap
would have to be in the __INTELLISENSE__
preprocessor block.