- Added
(Always)ReturnValCaptthat forces the capture of its parameter by value (even if the function returns a reference) and(Always)ReturnRefCaptthat forces the capture of its parameter by reference (even if the function returns a value). #280 #332 #356- DEPRECATION NOTICE: Previously, to replicate this functionality, some people used to provide explicit template parameters to
Returnfunctions, like.Return<std::string>(str)for a function returningconst std::string&. NowReturnValCaptcan be used instead, it is more explicit and safer, all usages of the previous (undocumented / unsupported) hack should be replaced by the new syntax. Same goes for.Return<std::string&>(str)that can now be replaced byReturnRefCapt. - (potentially) BREAKING: Disabled
(Always)Returntaking an rvalue-reference for functions returning a reference. Most often than not, this was the cause of dangling references. Now it prints a nice error message suggesting to use a safe alternative ((Always)ReturnValCapt).
- DEPRECATION NOTICE: Previously, to replicate this functionality, some people used to provide explicit template parameters to
- Made
fakeit::Mockobjects move-constructible (and disabled the copy-constructor). #334 - Now objects passed by rvalue-reference to
.Return()will be moved, even if they are copyable (i.e.std::moveis respected). Before that, objects that were copyable were always copied, independent of how they were passed. #330 - Fixed a compile error on Clang 19. #350
- Fixed some warnings in the library. #322 #355 #358
- Added a macOS runner that tests the library with AppleClang in the CI. Also added a 64 bits MSVC job, but without RTTI-dependent tests, because RTTI-related features of FakeIt aren't supported in MSVC 64 bits. Plus some CI improvements. #319 #321 #333 #335 #352
- Added a tool to help create compilation speed benchmarks. #338
- Fixed some warnings in the tests. #329