TEMPLATE FUNCTION swap

Tring to give new life to an old Asherons call game emulator, have trouble with the code below.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// TEMPLATE FUNCTION swap
template<class _Ty,
	size_t _Size> inline
	void swap(_Ty (&_Left)[_Size], _Ty (&_Right)[_Size])
	{	// exchange arrays stored at _Left and _Right
	if (&_Left != &_Right) 
		{	// worth swapping, swap ranges
		_Ty *_First1 = _Left;
		_Ty *_Last1 = _First1 + _Size;
		_Ty *_First2 = _Right;
		for (; _First1 != _Last1; ++_First1, ++_First2)
			_STD iter_swap(_First1, _First2);
		}
	}

This returns error:
Error 6 error C2248: 'cMessage::cBlock::operator =' : cannot access private member declared in class 'cMessage::cBlock' c:\program files (x86)\microsoft visual studio 11.0\vc\include\utility 48 1 UAS
Last edited on
What's the problem?
Topic archived. No new replies allowed.