#include #include #include #include #include #include using namespace std; // Dump routines template void dumpContainer(const T c) { for (typename T::const_iterator it = c.cbegin(); it != c.cend(); it++ ) { cout << *it << ' '; } cout << endl; } void dumpNativeArray(const int a[], unsigned int size) { for (unsigned int i=0; i stringVec = {"one", "two", "three"}; deque intDeque = {1, 2, 3}; list floatList = {1.0, 2.0, 3.0}; forward_list doubleForwardList = {1.0, 2.0, 3.0}; int nativeArray[3] = {1, 2, 3}; //---------------------------------------------------------------- // In some cases, the compiler can infer the the type of the // templated function! //---------------------------------------------------------------- dumpContainer(str); dumpContainer(stringVec); dumpContainer(intDeque); dumpContainer(floatList); dumpContainer(doubleForwardList); dumpNativeArray(nativeArray, 3); return 0; }