本文整理汇总了C++中BasicVec::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ BasicVec::contains方法的具体用法?C++ BasicVec::contains怎么用?C++ BasicVec::contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BasicVec
的用法示例。
在下文中一共展示了BasicVec::contains方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void StructCompactor::ItemStr::make_defi( String &os, const String &pr, BasicVec<String> &already_defined ) {
if ( already_defined.contains( pr + type ) )
return;
already_defined << pr + type;
static const char *lsl[] = { "_load", "_save" };
for( int save = 0; save < 2; ++save ) {
const char *ls = lsl[ save ];
for( int gpu = 0; gpu < 2; ++gpu ) {
if ( gpu ) {
os << "__global__\n";
os << "void " << pr.replace( ':', '_' ) << type << "__update_ptr_gpu" << ls << "( " << pr << type << " *obj, ST off ) {\n";
} else
os << "void " << pr << type << "::update_ptr_cpu" << ls << "( ST off ) {\n";
//
for( int i = 0; i < items.size(); ++i )
items[ i ]->make_uptr( os, ( gpu ? "obj->" : "" ) + items[ i ]->name, 0, " ", save );
os << "}\n";
os << "\n";
if ( gpu ) {
os << "void " << pr << type << "::update_ptr_gpu" << ls << "( ST off ) {\n";
os << " " << pr.replace( ':', '_' ) << type << "__update_ptr_gpu" << ls << "<<<1,1>>>( this, off );\n";
os << "}\n";
os << "\n";
}
}
}
for( int i = 0; i < items.size(); ++i )
items[ i ]->make_defi( os, pr + type + "::", already_defined );
}