This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: is_explicitly_convertible


Hi Paolo,

after reading the new standard's draft once again, I tried to implement is_constructible (which has two cases) and I used that to implement is_explicitly_convertible on top of it (which is a no-brainer, really).

The draft (N3000) requires the two-argument-form to test for

  static_cast<To>(create<From>())

to be valid, using

  template<typename T> typename add_rvalue_reference<T>::type create();

The other forms of is_constructible require

  To(create<From>()...)

instead. While trying to implement that, I got stuck with another ICE for GCC 4.4 and I can't test GCC 4.5 - if it works, we could have both, otherwise it might be worth to send another bug report against 4.5? Note that the code does work for two-argument forms (like is_explicitly_convertible) on GCC 4.4, though.

I attached the code which I think *should* work. If for GCC 4.5 it actually works, we could add both is_constructible and is_explicitly_convertible (well, at least as good as it gets until front-end support arrives...)

Thanks for taking the time to test and adapt this for GCC, I really appreciate it :)

Regards, Daniel


Attachment: is_constructible.cpp
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]