私は現在、集合計算を含むプロジェクトに取り組んでいます。関数 set_union と set_intersection を使用して、セットの結合と交差を計算しています。私の変数は次のとおりです。
int AunionB[8];
int AunionC[7]; // define AunionC
int BunionD[9]; // define BunionD
int AintersectB[4]; // define AintersectB
int AintersectC[3]; // define AintersectC
set<int> finalUnion; // final union of A, B, C, D
set<int> finalIntersection; // final intersection of A, B, C, D
これらは、それぞれ setA、setB、setC、および setD の 4 つの集合の和集合と共通集合です。私の set_union 関数は次のとおりです。
set_union(AunionC, AunionC+7, BunionD, BunionD+9, finalUnion.begin());
私の set_intersection 関数は次のとおりです。
set_intersection(AintersectB, AintersectB+4, AintersectC,
AintersectC+3, finalIntersection.begin());
コンパイルすると、「Required from here」というエラーが表示されますが、その意味はよくわかりません。誰かがこれで私を助けてくれますか? set_union および set_intersection 関数とそのパラメーターに関係があると思いますが、よくわかりません。