r/cpp • • Jul 04 '18

Be Mindful with Compiler-Generated Move Constructors

https://ibob.github.io/blog/2018/07/03/compiler-generated-move/
89 Upvotes

46 comments sorted by

View all comments

Show parent comment

1

u/meneldal2 Jul 05 '18

I guess you could add (another) parameter to the std::function template, that will determine whether move is constexpr or not. It would default to this unless the function needs to allow exceptions, and a implicit conversion from exception-less std::function to exception-allowed std::function would be added.

Is there something I'm missing here?