#include <iostream>
#include <type_traits>

template < typename T >
void foo( const T& arg ) {
    using namespace std;
    
    cout << "foo: ";
    if( is_same<int,T>::value ) {
        cout << "<int> " << arg << endl;
    } else if( is_same<long,T>::value ) {
        cout << "<long> " << arg << endl;
    } else if( is_same<std::string,T>::value ) {
        cout << "<string> " << arg << endl;
    } else {
        cout << "<other> " << arg << endl;
    }
}

int main() {
    
    foo( 1 );
    foo( 2L );
    foo( 3u );
    foo( std::string("hello world") );
}