TartanLlama / optional

C++11/14/17 std::optional with functional-style extensions and reference support
https://tl.tartanllama.xyz
Creative Commons Zero v1.0 Universal
859 stars 67 forks source link

`map` breaks with const-only functions and generic lambdas #1

Closed TartanLlama closed 7 years ago

TartanLlama commented 7 years ago
struct foo {
    void non_const() {}
};

tl::optional<foo> f;
f.map([](auto&& x) { x.non_const(); } //does not compile

This is due to the issue noted here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0826r0.html

Thanks to @markpapadakis for the report.