indirect_value
indirect_value copied to clipboard
Explicitly disable support for use with lambda
To keep the reference implementation simple we should not attempt to support using SFINAE to enable default construction based on the copier type.
Static asserts should be provided to make it obvious to the user why this fails if they try to use a lambda (non-default constructable class with it).
This implementation currently targets C++17 (even though the proposal is for C++23). Lambda cannot work with indirect_value (or the underlying unique_ptr) until C++20 when changes to support assigning of default capture lambdas was added to the language:http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0624r2.pdf
As such, this is implicitly disabled (however there would be value in adding static asserts to inform the user of the reason why this is failing).