Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: | >>>>> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: | | Lars> Andre Poenitz <[EMAIL PROTECTED]> writes: | I just wonder why this | Lars> had worked before for everybody: | | Lars> Because nobody has used lyxstring for a long, long time. | | Lars> There are no automatic conversion from basic_string<> to | Lars> lyxstring. | | Just to satisfy my curiosity, would something like that work? | | lyxstring::lyxstring(std::string const &str) | { | //what should I put here? Can I call the char const * constructor? | } | | Of course, one has to #include <string> always to make it work, and | this could be costly. Would the following hack work? | | template<class strclass> | lyxstring::lyxstring(T const &str) | { | // use str.c_str() here, which will break of course if T is not | // std::string... | }
Perhaps, but I do not want it. (and your T has to be renamed to strclass) and instead of the STRCONV(), you would need a string(). So what did you really gain? (except hiding the ugly conversion) -- Lgb