error C3892: 'std::_Tree_unchecked_const_iterator

plz help me for this error and ... (visual studio 2010)


void file_remove(u32 id, int action)
{	file f;
	f.id = id;

	file_set::iterator i = fs.find(f);

	if(i == fs.end()) return;

	// move cursor away
	if(conf.expose.cursor == id) cursor_down();
	if(conf.expose.cursor == id) cursor_up();
	if(conf.expose.cursor == id) conf.expose.cursor = 0;


	if(action != 1 && i->size >= conf.files.incomp_min_size &&
		(u64)segment_summ(i->seg) * 100 / i->size >= conf.files.incomp_percent)
	{	action = 2;
	}

	char n1[0x100];
	char n2[0x100];
	

	if(!i->deleted){
		cache_close(i->h);

		snprintf(n1, sizeof(n1), "%s/%s", conf.fnames.dir_temp, i->name.c_str());

		if(action == 0)
		{	// just close
		}
		else if(action == 1)
		{	snprintf(n2, sizeof(n2), "%s/%s", conf.fnames.dir_ok, i->name.c_str());
		seg(*i, conf.fnames.dir_temp, false);
		cache_move(n1, n2);
		}
		else if(action == 2)
		{	snprintf(n2, sizeof(n2), "%s/%s", conf.fnames.dir_incomplete, i->name.c_str());
		seg(*i, conf.fnames.dir_incomplete, true, true);
		seg(*i, conf.fnames.dir_temp, false);
		cache_move(n1, n2);
		}
		else if(action == -1)
		{	seg(*i, conf.fnames.dir_temp, false);
		cache_move(n1, ""); // unlink
		}
	} else {
		ffs_remove(i->size, i->tag);
		fs.erase(i);
		sort_files();
		return;
	}

	if(!i->tmp){
		ffs_remove(i->size, i->tag);
		fs.erase(i);
	} else {
		i->deleted = true;
	}
	sort_files();
}


error this line : i->deleted = true; and view this result

1
2
3
4
5
6
1>main.cpp(478): error C3892: 'std::_Tree_unchecked_const_iterator<_Mytree,_Base>::operator ->' : you cannot assign to a variable that is const
1>          with
1>          [
1>              _Mytree=std::_Tree_val<std::_Tset_traits<file,std::less<file>,std::allocator<file>,false>>,
1>              _Base=std::_Iterator_base
1>          ]


plz help me


Is file_set a std::set? The elements in a std::set is const so you can't manipulate them.
Topic archived. No new replies allowed.