#include <iostream>
using namespace std;
struct Logger
{
template<typename Type>
using IsRawString =
std::integral_constant<bool, 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>::value>>
{
static const int Index = 2;
};
template<typename Type>
struct Traits<Type, std::enable_if_t<std::is_pointer<Type>::value && !IsRawString<Type>::value>>
{
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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnN0cnVjdCBMb2dnZXIKewogICAgdGVtcGxhdGU8dHlwZW5hbWUgVHlwZT4KICAgIHVzaW5nIElzUmF3U3RyaW5nID0KICAgICAgICBzdGQ6OmludGVncmFsX2NvbnN0YW50PGJvb2wsIHN0ZDo6aXNfc2FtZTxjb25zdCBjaGFyKiwgVHlwZT46OnZhbHVlIHx8IHN0ZDo6aXNfc2FtZTxjaGFyKiwgVHlwZT46OnZhbHVlPjsKCiAgICB0ZW1wbGF0ZTx0eXBlbmFtZSBUeXBlLCB0eXBlbmFtZSBFbmFibGUgPSB2b2lkPgogICAgc3RydWN0IFRyYWl0cwogICAgewogICAgICAgIHN0YXRpYyBjb25zdCBpbnQgSW5kZXggPSAxOwogICAgfTsKCiAgICB0ZW1wbGF0ZTx0eXBlbmFtZSBUeXBlPgogICAgc3RydWN0IFRyYWl0czxUeXBlLCBzdGQ6OmVuYWJsZV9pZl90PElzUmF3U3RyaW5nPFR5cGU+Ojp2YWx1ZT4+CiAgICB7CiAgICAgICAgc3RhdGljIGNvbnN0IGludCBJbmRleCA9IDI7CiAgICB9OwoKICAgIHRlbXBsYXRlPHR5cGVuYW1lIFR5cGU+CiAgICBzdHJ1Y3QgVHJhaXRzPFR5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