我尝试使用 abseil 的字符串库,但是这个简单的示例已经没有运行并且失败了terminate called after throwing an instance of 'std::bad_alloc'
。
我使用的片段
#include "absl/strings/str_cat.h"
#include "fmt/core.h"
int main(){
auto s1 = absl::StrCat("A string ", " another string", "yet another string");
fmt::print( "{}\n", s1);
}
我将 Abseil 20200923.2 与 conan/cmake 一起使用。我尝试了 gcc 10.1 和 clang 11,结果相同。我怎样才能让这段代码运行?