本文整理汇总了C++中std::experimental::string_view::to_string方法的典型用法代码示例。如果您正苦于以下问题:C++ string_view::to_string方法的具体用法?C++ string_view::to_string怎么用?C++ string_view::to_string使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::experimental::string_view
的用法示例。
在下文中一共展示了string_view::to_string方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toBeLoggedRuntime
bool Tial::Utility::Logger::toBeLoggedRuntime(Level level, const std::experimental::string_view &module) {
auto moduleLevel = levels.find(module.to_string());
if(moduleLevel == levels.end()) {
auto sep = module.rfind("::");
if(sep == module.npos)
return level >= globalLevel;
return toBeLoggedRuntime(level, module.substr(0, sep));
}
return level >= moduleLevel->second;
}
示例2: catch
void Tial::Testing::Thread::operator()(const std::experimental::string_view &name) {
std::promise<void> result;
this->result = result.get_future();
thread = std::thread([name=name, function=function, checker=Check::checker()](std::promise<void> result){
Utility::Thread::setName(name.to_string());
Check::setChecker(checker);
try {
function();
result.set_value_at_thread_exit();
} catch(std::exception e) {
LOGC << "Exception in subthread: " << e.what();
throw;
} catch(...) {
LOGC << "Exception in subthread";
result.set_exception_at_thread_exit(std::current_exception());
}
}, std::move(result));
}
示例3:
void Tial::Utility::Logger::setLoggingLevel(Level level, const std::experimental::string_view &module) {
levels[module.to_string()] = level;
}
示例4: file
Tial::Utility::Logger::Message::Message(
const std::experimental::string_view &file, unsigned int line, const std::experimental::string_view &function,
const std::experimental::string_view &prettyFunction, Level level, const std::experimental::string_view &module,
const TimePoint &time
): file(file.to_string()), line(line), function(function.to_string()), prettyFunction(prettyFunction.to_string()),
level(level), module(module.to_string()), time(time) {}