Boost logo

Boost Users :

From: Victor A. Wagner Jr. (vawjr_at_[hidden])
Date: 2005-06-15 11:50:41


At 08:49 2005-06-15, Stephen Gross wrote:
>I'm trying to find a way to see if a given object is convertible to
>std::string, but with certain restrictions. Normally, is_convertible<> would
>be fine, but in this case it doesn't work for my needs.
>
>Here's the situation in more detail. I've got a class Foo with a string
>conversion operator:
>
>class Foo { public: operator std::string () const; };
>
>I want some kind of is_convertible<Foo, std::string> to return FALSE, but
>something like is_convertible<char*, std::string> to return TRUE. Basically,
>I want is_convertible to check to see if the target type (std::string) has
>an implicit constructor taking the input type; I *don't* want is_convertible
>to check to see if the input type has a conversion-to-target-type function.

the difference between them being? (I don't mean implementation here, I
mean "meaning").

>Is there a way to do this?
>
>--Steve
>_______________________________________________
>Boost-users mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users

Victor A. Wagner Jr. http://rudbek.com
The five most dangerous words in the English language:
               "There oughta be a law"


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net