Created
August 10, 2011 18:13
-
-
Save ahankinson/1137670 to your computer and use it in GitHub Desktop.
comparing pointers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool MeiElement::hasChild(MeiElement *child) { | |
for (vector<MeiElement*>::iterator iter = _children.begin(); iter != _children.end(); ++iter) { | |
if((&child) == &(*iter)) { | |
return true; | |
} | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
include
bool MeiElement::hasChild(MeiElement *child) const
{
return std::find(children_.begin(), children_.end(), child) != children_.end();
}