-
Notifications
You must be signed in to change notification settings - Fork 178
Fix lot of stuffs with .*Return*. #356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…returning a reference, and improved ReturnCapture to construct the return type from the parameter if their reference is not compatible (to allow things like function-returning-std-string.ReturnCapture("string")).
…and added some tests.
…eference (in a deprecated manner), and other minor fixes.
|
Hello @otrempe and @malcolmdavey, from what I understood from things you said in other issues, you have some codebases that use explicit template specializations for If you can, I would like you to test this PR with your codebase (I already generated the single headers here: https://github.com/eranpeer/FakeIt/tree/make-return-with-spe-works-again-and-bonuses/single_header), because previous versions of FakeIt 2.5.0-dev disabled this (undocumented) feature, but I tried to add it back, and I would like to know if it works for more complexes use cases than the ones I come up in the unit tests. I would really like to be able to release 2.5.0 without breaking anyone's code, if anyone can help I would be really grateful. |
Hi Frank. As it turns out I hadn't actually used any cases of explicit types yet, but had just added unit tests for fakeit to give more complete coverage. My existing code (using fakeit 2.4 ?) Now compared to AlwaysReturn/Return, since it doesn't know the type, I need to make the type explicit I guess this is less ideal compared to the behaviour of Return/AlwaysReturn, but it isn't a big deal. |
|
Also found an unrelated compile error here that I posted here |
|
I didn't thought about that, yeah adding a default type for the template so you don't need to explicitly provide one is easy, I tried on Godbolt and it works, I'll change that. Thank you for the suggestion ! Thanks for reporting the bug with msvc, I'll fix that as well. |
Basically what's here: #337, will write something better later.