小编jus*_*rxl的帖子

如何从 C++/cx 中的嵌套任务返回值?

我有一堆这样的线程任务:

create_task(somewinrtasyncfunction()).then([this(variable_that_the_last_task_returned)
{
    //task here
    return info;
}).then([this](info)
{
    //another task here
    return status});
Run Code Online (Sandbox Code Playgroud)

status现在我想在任务之外、调用它的函数中使用。我如何访问它?

c++ multithreading visual-c++ c++-cx win-universal-app

2
推荐指数
1
解决办法
1367
查看次数

如何使用正则表达式删除std :: wstring中特定短语的所有实例?

我试图遵循这个答案:https://stackoverflow.com/a/32435076/5484426,但对于std :: wstring.到目前为止,我有这个:

std::wstring str = L"hello hi hello hi hello hi";
std::wregex remove = L"hi";
Run Code Online (Sandbox Code Playgroud)

现在我想这样做:regex_replace(str,remove,""); 虽然看起来regex_replace不适用于wstring.如何删除此字符串的所有实例?

c++ regex string replace std

0
推荐指数
1
解决办法
279
查看次数