From the exception (Exception class) used in C++stl, when working with Rapidxml, the XML file is found in an error that throws an exception. Focus on the next, as a model to do.
I also specifically wrote a function to allocate memory, if the distribution is found to be unsuccessful, throw STL Bad_alloc exception, found that good, the program appears more normative (self-feeling, hehe).
In fact, when writing a program, if you develop a good habit of writing Try{}catch () {}, you will not see a lot of annoying error windows, you can try to deal with these errors.
In the use of rapidxml, really feel the benefits of the template, have been learning before, know that there is this thing, never use. Immediately, feel that the template in C + + is very good, very powerful. You don't have to see any CPP files in the future.
So the implementation of the template is in the header file. (one interview asked this, the answer is wrong.) )
There is a good article on CSDN. Please refer to
http://blog.csdn.net/songzi1111/article/details/9299587
C + + exception