名称空间"std"中没有名为"size"的成员 [英] No member named 'size' in namespace 'std'

查看:197
本文介绍了名称空间"std"中没有名为"size"的成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将某些C ++代码从Windows移植到OS X(使用Xcode).

以下代码:

  writePosition%= std :: size(bufferL); 

正在生成错误:

在命名空间"std"中没有名为"size"的成员

我该如何解决?

解决方案

std :: size()可用 解决方案

std::size() is available starting from C++17. Try enabling -std=c++17 for your compiler.

Also, double check that the source files contain #include <iterator>, either directly, or indirectly by #include'ing any of the following headers:

  • <array>
  • <deque>
  • <forward_list>
  • <list>
  • <map>
  • <regex>
  • <set>
  • <string>
  • <string_view>
  • <unordered_map>
  • <unordered_set>
  • <vector>

这篇关于名称空间"std"中没有名为"size"的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆