containers/member-types/mem-types-1.cpp - Illustration of the use of member types for a list of chars. | Lecture 6 - slide 13 : 40 Program 1 |
// Examples of member types of list<T>. #include <iostream> #include <string> #include <list> int main(){ using namespace std; list<char> lc; lc.push_back('a'); lc.push_back('b'); lc.push_back('e'); list<char>::value_type x = 'c'; // A complicated way to denote the type char list<char>::iterator lc_it = lc.begin(); // The iterator type of list<char> list<char>::size_type sz = lc.size(); // The size type of list<char> }