Boost logo

Boost :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-09-05 00:17:45


Robert Ramey wrote:

> Vladimir Prus wrote
>
>>1. When I run "bjam" in "examples", I see:
>
>>don't know how to make <libs!serialization!example>demo_mi.cpp
>>don't know how to make
>><libs!serialization!example>demo_unregistered_ptrs.cpp
>
> I moved these demos over to tests and forgot to update the jamfile.

I see.

>>class C {
>>public:
>> explicit C(int) {}
>>};
>
>>int main()
>>{
>> int i = 0;
>> static_cast<C>(i);
>> return 0;
>>}
>
>>Does not work with 3.3. Works with 3.2. Works with 3.3 if "explicit" is
>>removed. I'd say it's a gcc regression, so I went ahead and filed
>>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12163
>
> Having had other instances of this sort, I would guess you'll get
> a response like "the new behaviour is required by the standard
> paragram 123.12321.1234 a) " . So my inclination is to check
> all the cases where I've used the above. I'll look into this.

In fact, their response is better: this is confirmed as regression, so
chances of fixing it are high. I am not sure in what version it will be
fixed, though.

If I remove "explicit" I have another error from g++:

/home/ghost/Work/boost/boost/archive/basic_binary_oarchive.hpp: In member
   function `boost::archive::basic_binary_oarchive<OStream>&
   boost::archive::basic_binary_oarchive<OStream>::operator<<(const T&)
[with T
   = unsigned int, OStream = std::ostream]':
../src/binary_oarchive.cpp:25: instantiated from here
/home/ghost/Work/boost/boost/archive/basic_binary_oarchive.hpp:130: error:
ISO
   C++ says that `void
   boost::archive::basic_binary_oarchive<OStream>::save_override(const T&,
long
   int) [with T = unsigned int, OStream = std::ostream]' and `void
   boost::archive::basic_binary_oarchive<OStream>::save_override(const
   boost::archive::object_reference_type&, int) [with OStream =
std::ostream]'
   are ambiguous even though the worst conversion for the former is better
than
   the worst conversion for the latter

That's most likely because removing "explicit" adds the second function to
the list of viable one for overload resolution.

Hmm... I don't know how to make 3.3 happy. Not to mention that I don't
understand what's "worst conversion", in the error message.

- Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk