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.
thanks in advance,
George
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