【C++】STL(Standard Template Library)相談室 11at TECH
【C++】STL(Standard Template Library)相談室 11 - 暇つぶし2ch7:デフォルトの名無しさん
09/01/11 16:34:28
早速質問です。
set< set< int > > s;
set< set< int > >::iterator i( s.begin() );
i->insert( 12 );

をコンパイルすると、
  error: passing 'const std::set<int, std::less<int>, std::allocator<int> >' as
  'this' argument of 'std::pair<typename std::_Rb_tree<_Key, _Key, std::_Identity<_Key>, _Compare, _Alloc>::const_iterator, bool>
  std::set<_Key, _Compare, _Alloc>::insert(const _Key&) [with _Key = int, _Compare = std::less<int>, _Alloc = std::allocator<int>]' discards qualifiers

と言われる。
これは何が間違ってる?


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch