value::operator[] 运算符

访问 JSON 对象的字段。

_ASYNCRTIMP value & operator [] (
   const utility::string_t &key
);

_ASYNCRTIMP const value & operator [] (
   const utility::string_t &key
) const;

_ASYNCRTIMP value & operator [] (
   size_t index
);

_ASYNCRTIMP const value & operator [] (
   size_t index
) const;

参数

  • key
    字段的名称

  • index
    JSON 数组中元素的索引。

返回值

对保留在字段中的值的引用

要求

**标头:**json.h

**命名空间:**web::json

请参见

参考

value 类