标签:style blog color os width io
Author:DriverMonkey
Mail:bookworepeng@Hotmail.com
Phone:13410905075
QQ:196568501
#include <string.h> #include <iostream> #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <map> using namespace std; class a_t { public: const static map <int, int> test_map; }; const map <int, int> a_t::test_map = { map<int, int>::value_type(1,2), map<int, int>::value_type(2,3), map<int, int>::value_type(3,4), map<int, int>::value_type(5,6), }; int main(void) { for(auto it = a_t::test_map.begin(); it != a_t::test_map.end();it++) { cout<<"test_map.key = "<<it->first<<endl; } a_t::test_map; }
const map 成员变量初始化例子,码迷,mamicode.com
标签:style blog color os width io
原文地址:http://blog.csdn.net/drivermonkey/article/details/24672509