fork download
template < typename T > // T is a type
    typename T::value_type // T::value_type is a type
        front( T& c )
            { return c.front() ; } // T has a member 'front' which is callable

struct A
{
    using value_type = const int* ;
    value_type front() const { return &value ; }
    int value = 8 ;
};

#include 
#include 

int main ()
{
    std::vector cntr { 1234, -7, 345, 6789 } ;
    std::cout << front(cntr) << '\n' ; // T => std::vector, T::value_type => int

    A a ;
    std::cout << front(a) << '\n' ; // T => A, T::value_type => const int*
}
Success #stdin #stdout 0s 2984KB
stdin
Standard input is empty
stdout
1234
0xbfddba3c