I'm using rapidxml to parse some data, generate an xml document, and write it to a file. My code looks something like this:
#include <fstream>
#include "rapidxml_print.hpp"
int main()
{
std::ifstream file;
file.open(filename);
file << (object.xml_generating_function());
}
The prototype for function_creating_xml is:
rapidxml::xml_document<> MyClass::xml_generating_function();
And the operator overload for << is defined in rapidxml_print.hpp. Yet g++ won't compile for me, first showing this:
main.cpp: In function ‘int main(int, char**)’:
main.cpp:82:35: error: no match for ‘operator<<’ in ‘file << object.xml_generating_function()()’
main.cpp:82:35: note: candidates are:
And lists all the standard definitions for the operator, followed curiously by this:
rapidxml_print.hpp:412:36: note: template<class Ch> std::basic_ostream<Ch>& rapidxml::operator<<(std::basic_ostream<Ch>&, const rapidxml::xml_node<Ch>&)
It would seem I'm not passing it the right argument times, but how could this be? I'm passing it an output stream and an xml document, the types it demands.
No comments:
Post a Comment