E2316 'any_of'不是 'std' 的成员
E2316 'any_of' is not a member of 'std'
所以我正在尝试使用std::any_of()
函数,但是C++生成器 6 说有一个错误:
[C++错误] Unit1.cpp(93): E2316 "any_of"不是"std"的成员
但我的单元中有#include <algorithm>
1.h
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <set>
#include <algorithm> // std::set_union, std::sort, etc
#include <vector> // std::vector
#include <math.h>
//--------------------------------------------------------------------------
我的单位1.cpp:
void __fastcall TForm1::Button7Click(TObject *Sender)
{
int el = StrToInt(LabeledEdit1->Text);
if ( std::any_of(A.begin(), A.end(), (*MyIteratorA==el)) ){
ShowMessage("true");
}else{
ShowMessage("false");
}
}
这很奇怪,因为我在同一个程序中使用了 std::set_union()
、std::set_intersection()
、std::set_difference()
等函数,直到 std::any_of
年一切正常。
对不起,英语不好。
C++ Builder 32 位不符合 C++11。对于所有 c++11 功能,您需要使用 64 位版本。
std::set_union
、std::set_intersection
和 std::set_difference
不是 C++11 特性,这就是它们工作的原因。
相关文章:
- std::ofstream 作为类成员删除复制构造函数?
- 使用 std::index_sequence 初始化具有固定大小数组成员的 POD 结构容器
- std::to_string - 'to_string' 不是 'std' 的成员 - Visual Studio Code 1.42.0
- 使用 std::async 时死锁,将来作为成员
- 可变参数模板参数扩展 类型为 std::function 的类成员
- FreeFileSync C++错误:'byte'不是 'std' 的成员
- 为什么 std::sort 找不到合适的(静态成员)函数重载?
- 对带有唯一指针的 std::thread 使用类成员函数时出现编译错误
- 在模板化成员函数的返回类型中使用 std::enable_if 时的编译器差异
- 有没有办法避免为 std::variant 类成员中的所有类型编写构造函数?
- 是否允许类类型的 std::function 成员变量(不完整类型)?
- 访问 std:vector 的类成员 std:vector 在一个类中与另一个 std:vector
- std::异步与非静态成员函数
- 如何在 c++11 中静态断言 std::array 类成员进行排序?
- 将初始化器列表/聚合初始化转发到 std::array 成员
- C++ IDE 不会推断/自动完成对模板类中的 std::array 下标表达式的成员访问
- 在哪里可以找到 std::bitset 的数据成员?
- 没有'str'成员在 GCC 和 Clang 'std::basic_ostream<char>',但 MSVC 没有问题
- unique_ptr问题:不是'std'成员
- std::成员函数的异步调用