map的一种替代方案,不会自动排序
看来只有用vector< std::pair<std::string, std::string> >了
...
#include <vector>
#include <string>
#include <iostream>
int main(int argc, char** argv)
{
using namespace std;
typedef pair <std::string, std::string> spair__;
typedef vector< spair__ > vector_type;
vector_type svec;
svec.push_back( spair__( "January", "2004-01" ) );
svec.push_back( spair__( "Feburary", "2004-02" ) );
svec.push_back( spair__( "March", "2004-03" ) );
svec.push_back( spair__( "April", "2004-04" ) );
svec.push_back( spair__( "May", "2004-05" ) );
for ( vector_type::iterator it = svec.begin();
it != svec.end();
++it )
cout << it->first << " " << it->second << "/n";
return 0;
}