1 月 2011

关于stl vector调用erase后的Vector iterators incompatible!

出错代码如下(VS2010),使用vector迭代器遍历并对满足条件的元素进行删除,

	vector::iterator it=m_vecDataUnits.begin();
	for (;it!=m_vecDataUnits.end();)
	{
		if (it->m_bSelected)
		{
			m_vecDataUnits.erase(it);
		}
		else
			it++;
	}

正确方法如下,删除vector元素后的it应该使用erase返回的值

	vector::iterator it=m_vecDataUnits.begin();
	for (;it!=m_vecDataUnits.end();)
	{
		if (it->m_bSelected)
		{
			it = m_vecDataUnits.erase(it);
		}
		else
			it++;
	}

EMG主动拾音器tone电位器配电容的范围

EMG User Forum上看到有人问道,记录官方回复:
by James K. on Tue Feb 17, 2009 3:34 pm

From our tech dept. — “0.033mf provides the most roll off, and the 0.22mf provides the least”

Hope that helped!

回来准备淘些电容换上试试看到底这个小东西对音色影响能有多大。