Actually, it looks like Jake is right. According to documentation it's undefined behavior since it's not a template specialization.
http://en.cppreference.com/w/cpp/language/extending_std Thanks, David On Fri, Sep 15, 2017 at 10:37 AM, Ernest Burghardt <eburgha...@pivotal.io> wrote: > cool that we could export into the std namespace, but as a library I don't > think it is a good idea as a user of our library might have done the same > thing and that is a situation we can easily/pro-actively avoid.... > > +1 object::toString() > > On Fri, Sep 15, 2017 at 11:33 AM, Mark Hanson <mhan...@pivotal.io> wrote: > > > Comments inlineā¦. > > > On Sep 15, 2017, at 10:25 AM, Jacob Barrett <jbarr...@pivotal.io> > wrote: > > > > > > -1 to all, comments below. > > > > > > > > >> On Sep 15, 2017, at 10:18 AM, Mark Hanson <mhan...@pivotal.io> wrote: > > >> > > >> So we have two approaches as their has been a veto on w_string, so it > > will not be used. > > > > > > Who said anything about veto? Nobody has veto authority. I simply > stated > > and opinion on the use of wstring based on my research in the past. > > > > > > > Ok, not vetoed. > > > > >> Approach 1) std::string str = object.to_string(); > > > To remain consistent with the APIs use of camel case this should be > > toString(); > > > > > > > Uh, yeah. Concept not code... > > > > > > > >> Approach 2) std::string str = std::to_string(object); > > > > > > Nobody countered my assertion that this is not legal to export into std > > names space. > > > > > > > class blobject > > { > > bool blobBool; > > }; > > > > > > namespace std { > > std::string to_String(blobject * blob) > > { > > return std::string("works"); > > } > > } > > > > > > int main() { > > > > blobject * blob = new blobject(); > > std::string str = std::to_String(blob); > > std::cout << "Hello, World! " << "value = " << str << std::endl; > > return 0; > > } > > /Users/mhanson/CLionProjects/untitled1/cmake-build-debug/untitled1 > > Hello, World! value = works > > > > Process finished with exit code 0 > > > > > > > -Jake > > > > > > > > > > >