本文整理汇总了C++中Twine::concat方法的典型用法代码示例。如果您正苦于以下问题:C++ Twine::concat方法的具体用法?C++ Twine::concat怎么用?C++ Twine::concat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Twine
的用法示例。
在下文中一共展示了Twine::concat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fmt
/// @brief Small string conversion via raw_string_stream.
template <typename T> std::string operator+(Twine LHS, const T &RHS) {
std::string Buf;
raw_string_ostream fmt(Buf);
fmt << RHS;
fmt.flush();
return LHS.concat(Buf).str();
}
示例2: LLVMCreateTargetMachine
LLVMTargetMachineRef LLVMCreateTargetMachine(const char* cpu, const char* triple, const char** feats, size_t nfeats)
{
// based on LDC code
// find target from the given triple and cpu
const Target* target = NULL;
for (TargetRegistry::iterator it = TargetRegistry::begin(),
ie = TargetRegistry::end(); it != ie; ++it)
{
#if 0
printf("cpu: %s target: %s\n", cpu, it->getName());
#endif
if (strcmp(cpu, it->getName()) == 0)
{
target = &*it;
break;
}
}
assert(target != NULL);
// add any features the user might have provided
Twine twine;
SubtargetFeatures features;
//features.setCPU(cpu);
for (size_t i = 0; i < nfeats; ++i)
{
features.AddFeature(feats[i]);
twine = twine.concat(features.getString());
}
// create machine
TargetMachine* targetMachine = target->createTargetMachine(triple, twine.str());
if (!targetMachine)
return NULL;
return wrap(targetMachine);
}