#include <type_traits>
#include <string>
#include <iostream>

using namespace std;

void testString(string value) {
    cout << "A string: " << value << endl;
}

void testInt(int value) {
    cout << "An int: " << value << endl;
}

template <typename U>
void testOther(U value) {
    cout << "Unknown type: " << value << endl;
}

template <typename T>
class Test {
public:
    
    constexpr Test(T value) : value(value) {}
    
    void test() {
        if (is_same<T, string>::value) {
            string &_value = (*reinterpret_cast<string *>(&value));
            testString(_value);
        } else if (is_same<T, int>::value) {
            int &_value = (*reinterpret_cast<int *>(&value));
            testInt(_value);
        } else {
            testOther(value);
        }
    }
    
private:
    
    T value;
};

int main() {
    Test<string>("Hello, world!").test();
    Test<int>(42).test();
    Test<float>(42.1).test();
}