- 177 名前:デフォルトの名無しさん [2024/01/23(火) 17:00:13.54 ID:kD0da0AW0.net]
- すみません。質問させて下さい。次のコードがMinGW-w64 g++ v13.2では --itrでエラーになります。わからないのはVisual studio 2022およびVisual StudioがサポートするClang LLVMでは通って正しく
実行しているように見えます。--itrの仕様がないのはMinGW-w64 g++v13.2が正しいのでしょうか?それともVisual Studioが正しいのでしょうか? #include <iostream> #include <unordered_set> using namespace std; int main() { unordered_set<int> us = { 1,2,3,4,5,6 }; for(auto itr = begin(us); itr != end(us); ++itr) cout << *itr << endl; auto itr = us.begin(); ++itr; ++itr; cout << *itr << endl; --itr; cout << *itr << endl; cin.get(); return 0; } MinGW-w64 g++ v13.2のエラー // error: no match for 'operator--' (operand type is 'std::__detail::_Node_iterator<int, true, false>')
|

|