本文整理汇总了C++中boost::container::flat_map::count方法的典型用法代码示例。如果您正苦于以下问题:C++ flat_map::count方法的具体用法?C++ flat_map::count怎么用?C++ flat_map::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::container::flat_map
的用法示例。
在下文中一共展示了flat_map::count方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addPSkill
int addPSkill(SkillInfo* skill)
{
assert(globalSkillTable.count(skill->sid)==0 && "duplicate HeroProfile");
globalSkillTable[skill->sid] = skill;
return globalSkillTable.size();
}
示例2: addHero
int addHero(HeroProfile* h)
{
assert(globalHeroTable.count(h->tableId)==0 && "duplicate HeroProfile");
globalHeroTable[h->tableId] = h;
return globalHeroTable.size();
}
示例3: assert
std::pair<double,double> FermiTable::calcAverageAtomicProperties
(const boost::container::flat_map<string,double>& tracers) const
{
double total = 0;
double aa = 0;
double zz = 0;
for(std::map<string,std::pair<double,double> >::const_iterator it=
atomic_properties_.begin();
it!=atomic_properties_.end();++it){
assert(tracers.count(it->first)==1);
const double mass_frac = tracers.find(it->first)->second;
const double A = it->second.first;
const double Z = it->second.second;
total += mass_frac;
aa += mass_frac/A;
zz += mass_frac*Z/A;
}
return std::pair<double,double>(total/aa,zz/aa);
}
示例4: HPT
const HeroProfile& HPT(int i)
{
assert(globalHeroTable.count(i) && "HeroProfile does not exist");
return *globalHeroTable[i]; }
示例5: PST
const SkillInfo& PST(int i)
{
assert(globalSkillTable.count(i) && "Skill does not exist");
return *globalSkillTable[i];
}