本文整理汇总了C++中Container::Contains方法的典型用法代码示例。如果您正苦于以下问题:C++ Container::Contains方法的具体用法?C++ Container::Contains怎么用?C++ Container::Contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::Contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool PropertyRestrictions<Key, KeyValue, Container>::Qualifies( const Container& rPropertiesContainer )
{
bool qualifies = true;
// individual has to have one of these properties
for( Container& container : _restrictions)
{
qualifies = false;
bool meets_property_restriction_criteria = true;
for( auto kv : container )
{
if( rPropertiesContainer.Contains( kv ) )
{
LOG_DEBUG_F( "Partial property restriction: constraint is %s.\n", kv.ToString().c_str() );
continue; // we're good
}
else
{
meets_property_restriction_criteria = false;
#ifdef WIN32
LOG_DEBUG_F( "Person does not get the intervention because the allowed property is %s and the person is %s.\n",
kv.ToString().c_str(), rPropertiesContainer.Get( kv.GetKey<Key>() ).ToString().c_str() );
#endif
break;
}
}
// If verified, we're done since these are OR-ed together
if( meets_property_restriction_criteria )
{
qualifies = true;
LOG_DEBUG_F( "Individual meets at least 1 of the OR-ed together property restriction conditions. Not checking the rest.\n" );
break;
}
}
return qualifies;
}