allocator implementation

Joined
Feb 12, 2008
Messages
108
Reaction score
0
Hello everyone,


I have debugged into STL implementation for allocator in file xmemory (Visual Studio 2008). I found it has not data members, the same as its base class _Allocator_base. Is that correct?

http://msdn2.microsoft.com/en-us/library/6s8wyf7c.aspx

My questions is what is the purpose of copy? It always returns true. Here is the code,

you can see do nothing for copy constructor as well.

Code:
allocator(const allocator<_Ty>&) _THROW0()
{
    // construct by copying (do nothing)
}

		// allocator TEMPLATE OPERATORS
template<class _Ty,
	class _Other> inline
	bool operator==(const allocator<_Ty>&, const allocator<_Other>&) _THROW0()
	{	// test for allocator equality (always true)
	return (true);
	}


thanks in advance,
George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top