|
Boost Users : |
Subject: Re: [Boost-users] overloaded const/non-const functions and bind
From: Andrej van der Zee (andrejvanderzee_at_[hidden])
Date: 2010-03-28 05:00:48
Hi Igor,
Thanks for your reply.
>
> You have to cast &Node::get_parent explicitly to one of the available
> overloads, to resolve ambiguity.
Any pointers on how to do this? My compiler keeps complaining. This is
how I cast:
NodeSet nodes_whitespace =
doc->get_root_node()->find("//text()[normalize-space()='']");
for_each(nodes_whitespace.begin(), nodes_whitespace.end(),
bind(&Node::remove_child,
bind(static_cast<Node*(Node::*)()>(&Node::get_parent), _1)));
This is what my compiler thinks about it:
main.cpp: In function void remove_whitespace_nodes(xmlpp::Document*):
main.cpp:58: error: invalid static_cast from type <unresolved
overloaded function type> to type xmlpp::Node* (xmlpp::Node::*)()
How should I do this then?
Thank you,
Andrej
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net