indirect_value icon indicating copy to clipboard operation
indirect_value copied to clipboard

Explicitly disable support for use with lambda

Open Twon opened this issue 5 years ago • 1 comments

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).

Twon avatar Oct 29 '19 12:10 Twon

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).

Twon avatar Feb 04 '20 00:02 Twon