Consider this struct:
struct foo {
void dummy() const {}
};
Is it possible to detect the constness of this method using SFINAE?
For example, I would like to capture this property in a trait that could be usable in a static_assert:
static_assert(is_const_method<decltype(&foo::dummy)>::value, "Not const!");
I thought that either std::is_const or std::remove_const would help me here but they don’t seem to encompass this “type” of constness.
Thanks,
Sure, looks like this: