本文整理汇总了C++中std::unordered_multimap::end方法的典型用法代码示例。如果您正苦于以下问题:C++ unordered_multimap::end方法的具体用法?C++ unordered_multimap::end怎么用?C++ unordered_multimap::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::unordered_multimap
的用法示例。
在下文中一共展示了unordered_multimap::end方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrettyPrint
inline std::string PrettyPrint(const std::unordered_multimap<A, B, Hash, Predicate, Allocator>& maptoprint, const bool add_delimiters=false, const std::string& separator=", ")
{
std::ostringstream strm;
if (maptoprint.size() > 0)
{
if (add_delimiters)
{
strm << "{";
typename std::unordered_multimap<A, B, Hash, Predicate, Allocator>::const_iterator itr;
for (itr = maptoprint.begin(); itr != maptoprint.end(); ++itr)
{
std::pair<A, B> cur_pair(itr->first, itr->second);
if (itr != maptoprint.begin())
{
strm << separator << PrettyPrint(cur_pair, add_delimiters, separator);
}
else
{
strm << PrettyPrint(cur_pair, add_delimiters, separator);
}
}
strm << "}";
}
else
{
typename std::unordered_multimap<A, B, Hash, Predicate, Allocator>::const_iterator itr;
for (itr = maptoprint.begin(); itr != maptoprint.end(); ++itr)
{
std::pair<A, B> cur_pair(itr->first, itr->second);
if (itr != maptoprint.begin())
{
strm << separator << PrettyPrint(cur_pair, add_delimiters, separator);
}
else
{
strm << PrettyPrint(cur_pair, add_delimiters, separator);
}
}
}
}
return strm.str();
}
示例2: findFromTextureCache
sf::RenderTexture* ShadowTextRenderer::findFromTextureCache(sf::Vector2u size)
{
auto it = shadowCache.find(size);
if (it != shadowCache.end())
{
auto ptr = it->second;
shadowCache.erase(it);
return ptr;
}
return 0;
}
示例3: make_pair
//calculate the given dynamical-network's maxminum B and its corresponding w
std::pair<int,double> calmaxBW(std::unordered_multimap<int,std::pair<int,int>> &SN)
{
int maxB = 0,temp,attractor = 0;
double Wn;
for(auto it = SN.begin(); it != SN.end(); it++){
if(it->first == it->second.first){
temp = calBRec(SN,it->second.first);
if(temp > maxB){
maxB = temp;
attractor = it->first;//main attractor
}
}
}
Wn = calWRec(SN,attractor,1,0);
return std::make_pair(maxB,Wn/maxB);
}
示例4: make_pair
//find the maximum B:basin for a given directed network
std::pair<int,double> findMaxBW(std::unordered_multimap<int,std::pair<int,int>> &SN,double *TF)
{
int maxB = 0,temp,attractor = 0;
double Wn;
for(auto it = SN.begin(); it != SN.end(); it++){
/**!!!!!!!!!!!your must change attractor!!!!!!!!**/
if(it->first == it->second.first && it->first == 76){
temp = findMaxBRec(SN,it->second.first,TF);
if(temp > maxB){
maxB = temp;
attractor = it->first;//main attractor
}
}
}
Wn = calWRec(SN,attractor,1,0);
return std::make_pair(maxB,Wn/maxB);
}