This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/66998] not_fn invocation is not SFINAE friendly


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66998

--- Comment #2 from Tomasz KamiÅski <tomaszkam at gmail dot com> ---
Sorry for missing using declaration. 

> It's certainly a nice QoI improvement. I was basically lazy when I implemented it and used decltype(auto) because it's convenient.

Yes, the decltype(auto) is convenient but the hard error produced in SFINAE
context make it acutally unusable in library. Just think of the mess that would
be caused by:
template<typename C>
delctype(auto) begin(C&& c) { return std::forward<C>(c).begin(); }

The not_fn is also not working with member pointers:
#include <experimental/functional>

using namespace std::experimental;

struct A
{
    bool mem;
};

int main()
{
    not_fn(&A::mem)(A{});
};
Should I create separate issue?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]