"Bjarke Roune" <[EMAIL PROTECTED]> writes: >> | How about using a std::string wrapper which contains the needed asserts? >> > >> | I'm thinking of inheriting a wrapper from std::string and import that in | the >> | global namespace rather than std::string. This way, LyX will always be | using >> | the assert-improved string, while there will be no problems interacting | with >> | anything, since anything that expects a std::string will get just that. | This >> | does have the drawback that the asserts will not function while the | string >> | is being handled by third party code. I don't know how important that is | to >> | you. >> >> Inheriting will mostlikely not work well, wrapping might work, >> | Mind telling me why?
std::string does not have a virtual destructor. It has never been inteded for inheritence. >> however >> you need std::string to be in namespace std for this to work and not >> all C++ libs do that yet. >> | it could still be done with a typedef, though the other solution is imho | more elegant. yes. -- Lgb