Merged r444:449 from the node refactoring branch to the trunk

This commit is contained in:
Jesse Beder
2011-03-03 00:19:26 +00:00
parent ced50538fe
commit ca5992b971
35 changed files with 421 additions and 860 deletions

View File

@@ -4,18 +4,16 @@
namespace YAML
{
Iterator::Iterator(): m_pData(0)
{
m_pData = new IterPriv;
}
Iterator::Iterator(IterPriv *pData): m_pData(pData)
Iterator::Iterator(): m_pData(new IterPriv)
{
}
Iterator::Iterator(const Iterator& rhs): m_pData(0)
Iterator::Iterator(std::auto_ptr<IterPriv> pData): m_pData(pData)
{
}
Iterator::Iterator(const Iterator& rhs): m_pData(new IterPriv(*rhs.m_pData))
{
m_pData = new IterPriv(*rhs.m_pData);
}
Iterator& Iterator::operator = (const Iterator& rhs)
@@ -23,14 +21,12 @@ namespace YAML
if(this == &rhs)
return *this;
delete m_pData;
m_pData = new IterPriv(*rhs.m_pData);
m_pData.reset(new IterPriv(*rhs.m_pData));
return *this;
}
Iterator::~Iterator()
{
delete m_pData;
}
Iterator& Iterator::operator ++ ()