Naios / function2

Improved and configurable drop-in replacement to std::function that supports move only types, multiple overloads and more
http://naios.github.io/function2
Boost Software License 1.0
539 stars 47 forks source link

Disable empty propagation if compiling as Objective-C++ to allow succ… #34

Closed Rajveer86 closed 4 years ago

Rajveer86 commented 4 years ago

…essful compilation of non-copyable callables

@Naios


What was a problem?

Non-copyable lambdas failed to compile in Objective-C++.

How this PR fixes the problem?

This PR disables the bool() operator optimisation if the class is being compiled as Objective-C++.

Check lists (check x in [ ] of list items)

Additional Comments (if any)

Not sure how to add a unit test since it would require compiling as Objective-C++.

Naios commented 4 years ago

I would prefer to improve the corresponding code in the empty bool propagation rather than making the behaviour dependent on the current build language since a change in the behaviour without explicit specification is a no-go.

Naios commented 4 years ago

I will close this as elaborated above and in #29. Feel free to open a new PR if you found a fix for the non working operator bool detection trait in Objective+C++.