#include <typeinfo>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#include <list>
using namespace std;
template< template<typename, typename> class container_type, typename value_type>
void foo(container_type<value_type,
std::allocator<value_type> > const& container)
{
cout << typeid(container_type).name() << endl;
cout << typeid(value_type).name() << endl;
}
int main(int argc, char* argv[])
{
foo(std::vector<int>());
foo(std::list<int>());
return EXIT_SUCCESS;
}
tricks
最新推荐文章于 2023-11-06 15:28:25 发布