Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'pred' cannot be used as a function in xml_attribute find_attribute #32

Closed
rohmer opened this issue Feb 25, 2015 · 2 comments
Closed

'pred' cannot be used as a function in xml_attribute find_attribute #32

rohmer opened this issue Feb 25, 2015 · 2 comments
Labels

Comments

@rohmer
Copy link

rohmer commented Feb 25, 2015

In file included from ../3rdParty/pugixml/pugixml/pugixml.cpp:17:0,
6> from ../3rdParty/pugixml/pugixml/pugiconfig.hpp:42,
6> from BlockHelper.h:2,
6> from BlockHelper.cpp:1:
6> ../3rdParty/pugixml/pugixml/pugixml.hpp: In instantiation of 'pugi::xml_attribute pugi::xml_node::find_attribute(Predicate) const [with Predicate = const char*]':
6> BlockHelper.cpp:38:33: required from here
6>C:\PI\OccupancyLibrary..\3rdParty\pugixml\pugixml\pugixml.hpp(531,20): error : 'pred' cannot be used as a function
6> if (pred(attrib)) <- Error

This could be stupid user tricks(tm) (Myself being the used), but I didn't change the source for pugixml, so it seems buggish.

@zeux
Copy link
Owner

zeux commented Feb 25, 2015

I think you meant to call xml_node::attribute() instead of xml_node::find_attribute().

find_attribute is predicate-based - you're meant to provide an object that can be called (e.g. a function or a functor). Unfortunately, there is no good way in C++ to limit the type of the argument to just callables so you get an error inside pugixml implementation.

@rohmer
Copy link
Author

rohmer commented Feb 25, 2015

Yup, chalk one up to stupid user tricks.  Thx for the fast reply.
  From: Arseny Kapoulkine notifications@github.com
To: zeux/pugixml pugixml@noreply.github.com
Cc: rohmer rohmer@yahoo.com
Sent: Wednesday, February 25, 2015 3:35 PM
Subject: Re: [pugixml] 'pred' cannot be used as a function in xml_attribute find_attribute (#32)

I think you meant to call xml_node::attribute() instead of xml_node::find_attribute().find_attribute is predicate-based - you're meant to provide an object that can be called (e.g. a function or a functor). Unfortunately, there is no good way in C++ to limit the type of the argument to just callables so you get an error inside pugixml implementation.—
Reply to this email directly or view it on GitHub.

@zeux zeux closed this as completed Feb 26, 2015
@zeux zeux added the invalid label Nov 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants