Ejemplo n.º 1
0
bool Deck::update(WEAK_CARD card)
{
	Card* temp = card.get();

	static const indices::type n = indices::IDX_INDEX;
	containter::nth_index<n>::type& indexBy = m_Container.get<n>();
	containter::nth_index_iterator<n>::type it = indexBy.find(card->GetIndex());
	if (indexBy.end() == it)
		return false;

	m_Container.erase(it);

	pair_value pair = m_Container.insert(temp);
	if (pair.second == false)
	{
		LOG_ERROR(_T("Cannot insert object | Index[%d]"), temp->GetIndex());
		return false;
	}

	return true;
}