#include <iostream>
using namespace std;
struct Logger
{
template<typename Type>
constexpr bool IsRawString()
{
return std::is_same<const char*, Type>::value || std::is_same<char*, Type>::value;
}
template<typename Type, typename Enable = void>
struct Traits
{
static const int Index = 1;
};
template<typename Type>
struct Traits<Type, std::enable_if_t<IsRawString<Type>()>>
{
static const int Index = 2;
};
template<typename Type>
struct Traits<Type, std::enable_if_t<std::is_pointer<Type>::value && !IsRawString<Type>()>>
{
static const int Index = 3;
};
};
int main()
{
cout << Logger::Traits<int>::Index << endl
<< Logger::Traits<char*>::Index << endl
<< Logger::Traits<const char*>::Index << endl
<< Logger::Traits<void*>::Index << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnN0cnVjdCBMb2dnZXIKewogICAgdGVtcGxhdGU8dHlwZW5hbWUgVHlwZT4KICAgIGNvbnN0ZXhwciBib29sIElzUmF3U3RyaW5nKCkKICAgIHsKICAgICAgICByZXR1cm4gc3RkOjppc19zYW1lPGNvbnN0IGNoYXIqLCBUeXBlPjo6dmFsdWUgfHwgc3RkOjppc19zYW1lPGNoYXIqLCBUeXBlPjo6dmFsdWU7CiAgICB9CgogICAgdGVtcGxhdGU8dHlwZW5hbWUgVHlwZSwgdHlwZW5hbWUgRW5hYmxlID0gdm9pZD4KICAgIHN0cnVjdCBUcmFpdHMKICAgIHsKICAgICAgICBzdGF0aWMgY29uc3QgaW50IEluZGV4ID0gMTsKICAgIH07CgogICAgdGVtcGxhdGU8dHlwZW5hbWUgVHlwZT4KICAgIHN0cnVjdCBUcmFpdHM8VHlwZSwgc3RkOjplbmFibGVfaWZfdDxJc1Jhd1N0cmluZzxUeXBlPigpPj4KICAgIHsKICAgICAgICBzdGF0aWMgY29uc3QgaW50IEluZGV4ID0gMjsKICAgIH07CgogICAgdGVtcGxhdGU8dHlwZW5hbWUgVHlwZT4KICAgIHN0cnVjdCBUcmFpdHM8VHlwZSwgc3RkOjplbmFibGVfaWZfdD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