問題タブ [custom-compare]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
3 に答える
89 参照

c++ - タプルのこの単純なカスタム コンパレーターが厳密/弱い順序付けでもクラッシュするのはなぜですか?

この単純な型のカスタム コンパレータはtuple<int, int, int>、以下のテスト例でクラッシュします。各呼び出しが戻り値を取得するコンパレーターのcoutステートメントで確認したので、タプル t1 と t2 の値がジャンクではないようです。cmpcmp

なぜこれがクラッシュしているのか分かりますか?この非常に単純なカスタム コンパレータに問題はありますか?