std::vectormy_vector; using vector_value_type = decltype(my_vector)::value_type;
templateIn this example, we define a utility function that takes any container and prints out its values. We use the value_type member of the container to get the type of the values stored in it, and then use static_cast to convert each element to that type before printing it out. Package library: Standard Template Library (STL)void print_container(const Container& container) { using value_type = typename Container::value_type; std::cout << "Container Values: "; for(const auto& element : container) { std::cout << static_cast (element) << " "; } std::cout << "\n"; }