Freelance software grandad
software created
extended or repaired
Follow me on Mastodon
Applications, Libraries, Code
Talks & Presentations
It get's more interesting if you're using some custom string type, or you want std::wstrings containing UCS-2 Unicode instead of expat's UTF-8 encoded const char*. In cases like this, the string conversion policy class would need to a little more work (although not too much). The big gain is that you can just drop it straight in, and the expat wrapper will hand out what you want. No second conversion layer on top, no further fiddling. Cool.
Andrei Alexandrescu's fantastic book Modern C++ Design describes this design approach in much more, and more illuminating, detail.
Freelance software grandad
software created
extended or repaired
Follow me on Mastodon
Applications, Libraries, Code
Talks & Presentations