#include <type_traits>
template <typename T, typename ...Ts>
struct is_first_arg_const_ptr
{
template <typename Ret>
static std::false_type
is_const(Ret (&f)(T*, Ts...));
template <typename Ret>
static std::true_type
is_const(Ret (&f)(const T*, Ts...));
};
class C {};
void fun2(C*) {}
void fun2(const C*, int) {}
static_assert(!decltype(is_first_arg_const_ptr<C>::is_const(fun2))::value, "");
static_assert(decltype(is_first_arg_const_ptr<C, int>::is_const(fun2))::value, "");
int main ()
{
return 0;
}
I2luY2x1ZGUgPHR5cGVfdHJhaXRzPgoKdGVtcGxhdGUgPHR5cGVuYW1lIFQsIHR5cGVuYW1lIC4uLlRzPgpzdHJ1Y3QgaXNfZmlyc3RfYXJnX2NvbnN0X3B0cgp7CiAgICB0ZW1wbGF0ZSA8dHlwZW5hbWUgUmV0PgogICAgc3RhdGljIHN0ZDo6ZmFsc2VfdHlwZQogICAgaXNfY29uc3QoUmV0ICgmZikoVCosIFRzLi4uKSk7CgogICAgdGVtcGxhdGUgPHR5cGVuYW1lIFJldD4KICAgIHN0YXRpYyBzdGQ6OnRydWVfdHlwZQogICAgaXNfY29uc3QoUmV0ICgmZikoY29uc3QgVCosIFRzLi4uKSk7Cn07CgpjbGFzcyBDIHt9OwoKdm9pZCBmdW4yKEMqKSB7fQp2b2lkIGZ1bjIoY29uc3QgQyosIGludCkge30KCnN0YXRpY19hc3NlcnQoIWRlY2x0eXBlKGlzX2ZpcnN0X2FyZ19jb25zdF9wdHI8Qz46OmlzX2NvbnN0KGZ1bjIpKTo6dmFsdWUsICIiKTsKc3RhdGljX2Fzc2VydChkZWNsdHlwZShpc19maXJzdF9hcmdfY29uc3RfcHRyPEMsIGludD46OmlzX2NvbnN0KGZ1bjIpKTo6dmFsdWUsICIiKTsKCmludCBtYWluICgpCnsKICAgIHJldHVybiAwOwp9Cg==