Closed jurko-gospodnetic closed 4 years ago
Thanks for your report, I fixed this in 93089d56b. It will be available once the fix passed the CI.
Confirmed this fixes both the problem reported here and the one I was seeing in my Visual Studio project, :-) Thanks!
@Naios
Perhaps I'm misunderstanding something, but I have a use-case where
fu2::function
&fu2::unique_function
usage fails to compile while the same code compiles and runs fine usingstd::function
.Commit Hash
noticed using
function2.hpp
sources from commit 7cd95374b0f1c941892bfc40f0ebb6564d33fdb9Expected Behavior
fu2::function
is a drop in replacement forstd::function
:-)Actual Behavior
fu2::function
andfu2::unique_function
usage fails to compile when modeling functions returning referencesSteps to Reproduce
run the following code - it should fail to compile, and then try commenting out the bottom part related to
fu2::function
&fu2::unique_function
objects modeling a reference returning function, which should make the program work as expected:on a successful run I get the following output:
when testing a failed compile on https://www.onlinegdb.com/online_c++_compiler, I get the following output:
Your Environment
tested on https://www.onlinegdb.com/online_c++_compiler
And quite likely similar errors occur using Visual Studio 2017 Update 3 compiler as I got to this example by attempting to trim down some code giving a warning on that compiler about a reference to a local variable or a temporary being returned. (The warning output there is completely useless as it just points to some FU2_DETAIL_EXPAND_QUALIFIERS() macro call and shows no additional code or information :-()