ホーム » VC » error C2678: 二項演算子 ‘=’ :

error C2678: 二項演算子 ‘=’ :

ある処理を関数にしてコンパイルすると,

--------------------構成: VFDiv_1 - Win32 Debug--------------------
コンパイル中...
VFDiv_1V.cpp
c:\program files (x86)\microsoft visual studio\vc98\include\algorithm(232) : error C2678: 二項演算子 '=' : 型 'const struct Vector2<double>' の左オペランドを扱う演算子は定義されていません。(または変換できません)(新しい動作; ヘルプを参照)
        c:\program files (x86)\microsoft visual studio\vc98\include\algorithm(228) : コンパイルされたクラスのテンプレートのインスタンス化 'void __cdecl std::_Iter_swap(const struct Vector2<double> *,const struct Vector2<double> *,struct Vector2<double> *)' の参照を確認してください
c:\program files (x86)\microsoft visual studio\vc98\include\algorithm(232) : error C2678: 二項演算子 '=' : 型 'const struct Vector2<double>' の左オペランドを扱う演算子は定義されていません。(または変換できません)(新しい動作; ヘルプを参照)
        c:\program files (x86)\microsoft visual studio\vc98\include\algorithm(228) : コンパイルされたクラスのテンプレートのインスタンス化 'void __cdecl std::_Iter_swap(const struct Vector2<double> *,const struct Vector2<double> *,struct Vector2<double> *)' の参照を確認してください
cl.exe の実行エラー

VFDiv_1.exe - エラー 2、警告 0

対象が ‘const struct Vector2<double>’ となっているので,わかり辛かった.
次の関数の,’const Vd2A& v2a’ を std::reverse(v2a.begin(),v2a.end()) として使用しているのが原因.

PLF_face_l	PLF_triangulation	(const Vd2A& v2a)
{
//	...
	std::reverse(v2a.begin(),v2a.end()) ;
//	...
	}

一度関数内の変数に置く必要がある.
error C2678

この投稿は役に立ちましたか ? 0 人中 0 人がこの 投稿 は役に立ったと言っています。
© 2009-2026 mish.work All Rights Reserved.

Powered by WordPress / Academica WordPress Theme by WPZOOM