37typedef std::map<std::string, int, std::less<std::string>,
38 std::allocator<std::pair<const std::string, int> > >
46 for (months_type::const_iterator it =
m.begin (); it !=
m.end (); ++it)
47 std::cout << (*it).first <<
" has " << (*it).second <<
" days\n";
58 typedef months_type::value_type value_type;
61 months.insert (value_type (std::string (
"January"), 31));
62 months.insert (value_type (std::string (
"Febuary"), 28));
63 months.insert (value_type (std::string (
"Febuary"), 29));
64 months.insert (value_type (std::string (
"March"), 31));
65 months.insert (value_type (std::string (
"April"), 30));
66 months.insert (value_type (std::string (
"May"), 31));
67 months.insert (value_type (std::string (
"June"), 30));
68 months.insert (value_type (std::string (
"July"), 31));
69 months.insert (value_type (std::string (
"August"), 31));
70 months.insert (value_type (std::string (
"September"), 30));
71 months.insert (value_type (std::string (
"October"), 31));
72 months.insert (value_type (std::string (
"November"), 30));
73 months.insert (value_type (std::string (
"December"), 31));
76 std::cout << months << std::endl;
79 months_type::iterator
p = months.find (std::string (
"June"));
82 if (
p != months.end ())
83 std::cout << std::endl << (*p).first <<
" has "
84 << (*p).second <<
" days\n";
std::map< std::string, int, std::less< std::string >, std::allocator< std::pair< const std::string, int > > > months_type
std::ostream & operator<<(std::ostream &out, const months_type &m)