【发布时间】:2020-07-16 21:11:16
【问题描述】:
我正在尝试将 nlohmann::json 类型的对象转储为来自 Visual Studio 调试器的可读字符串值。因此,为了从 nlohmann::json 实例调用转储方法,我使用了 Visual Studio 中间窗口。
但是,尽管我完全按照我应该的方式调用它,但似乎此方法运行不佳并返回 too few arguments in function call 错误。此外,如果我尝试将其输出设置为新的 std::string 类型,调试器将无法识别它。
myJsonObj
{m_type=object (1 '\x1') m_value={object=0x000001303ea66590 { size=2 } array=0x000001303ea66590 { size=1152921422937066337 } ...} }
m_type: object (1 '\x1')
m_value: {object=0x000001303ea66590 { size=2 } array=0x000001303ea66590 { size=1152921422937066337 } string=0x000001303ea66590 "0A_>0\x1" ...}
myJsonObj.dump()
too few arguments in function call
std::string x = myJsonObj.dump()
identifier "x" is undefined
知道如何正确地做到这一点吗?
【问题讨论】:
标签: c++ windows visual-studio debugging nlohmann-json