c ++中的相同代码会是什么样的,或者最接近它的代码是什么?
public class Skill{
public Skill(String name){
}
public static Map<String, Skill> getSkills(){
Map<String, Skill> skills = new Map<String, Skill>();
skills.add("Endurance", new Skill());
return skills;
}
}
答案 0 :(得分:2)
std::map<std::string,Skill*> skills;
skills["Endurance"] = new Skill();