0

だから私はstd::any_of()関数を使用しようとしていますが、C++ Builder 6 はエラーがあると言います:

[C++ エラー] Unit1.cpp(93): E2316 'any_of' は 'std' のメンバーではありません


しかし#include <algorithm>、私は Unit1.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>
//--------------------------------------------------------------------------

私のUnit1.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

下手な英語でごめんなさい。

4

1 に答える 1