Menu

Why is CopyTo protected?

trueant
2006-04-18
2013-05-20
  • trueant

    trueant - 2006-04-18

    I'm wondering why the CopyTo method in TiXmlElement is protected.  I need it because I just updated to the latest version and noticed that InsertEndChild requires a reference now instead of a pointer like it used to (or perhaps I hacked in my own version before).  In order to convert from a pointer to a reference I need the CopyTo function. 

    TiXmlElement node(_parent->Value());
    _parent->CopyTo(&node);
    _doc->InsertEndChild(node);

     
    • Lee Thomason

      Lee Thomason - 2006-04-18

      I think you want:

      TiXmlElement node = *_parent;
      ...make changes...
      _doc->InsertEndChild( node );

      lee

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.