You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
during the upgrade of my project from Visual Studio 2019 to Visual Studio 2022, I encountered a compilation error related to the FakeIt library. Specifically, I’m using the single_header/mstest/fakeit.hpp header. When I enable conformance mode in VS2022, the following error occurs
C2440 'return': cannot convert from 'fakeit::MockingContext<void,const uint8_t [],int32_t,int32_t>' to 'fakeit::MockingContext<void,const uint8_t *,int32_t,int32_t>'
Don't know a fix for fakeit, but it's unusual to have an array parameter in C++. I've used VS up to 2022, but never done that.
If using an array, it's better to actually have it as a reference with an actual size.
Also C++ allows reading the array size when templating const uint8_t (buffer&)[n], but then this may not suit a virtual method.
Not sure if changing this helps.
I guess the question is - why not otherwise have a pointer? Is it just trying to avoid a nullptr case?
I am aware that it's unusual to have an array parameter in C++, but I cannot simply change the signature of my code base for multiple reasons. I was able to compile every library I used in VS2022 except for this one. The code was compiling before in VS2019 with the conformance mode enabled.
Hello,
during the upgrade of my project from Visual Studio 2019 to Visual Studio 2022, I encountered a compilation error related to the FakeIt library. Specifically, I’m using the single_header/mstest/fakeit.hpp header. When I enable conformance mode in VS2022, the following error occurs
Here is the code :
The text was updated successfully, but these errors were encountered: