Boost logo

Boost Users :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2007-02-26 18:04:28


----- Mensaje original -----
De: Christoph <christoph.duelli_at_[hidden]>
Fecha: Lunes, Febrero 26, 2007 11:04 pm
Asunto: Re: [Boost-users] [multi index] warning when used
in copy constructor: should be explicitly initialized
Para: boost-users_at_[hidden]

> > You didn't get this before because the warned-about code is
> > new wrt to the Boost 1.33.1 version. Could you please try the
> > following: Replace lines 798-802 of ordered_index.hpp
> >
> > struct link_info
> > {
> > ordered_index_side side;
> > ordered_index_node_impl* pos;
> > };
> >
> > with
> >
> > struct link_info
> > {
> > link_info(){}
> >
> > ordered_index_side side;
> > ordered_index_node_impl* pos;
> > };
> >
> > Does this improve anything? BTW, the warning, again,
> > does not reflect any actual problem with the code :(
> No, no change. Which is not really a surprise, as the
> constructor does not really initialize anything, right?

Well, it was cheap to try :)

> When I write link_info() : side(to_left) {}
> the warning is gone.

I am reluctant to apply this change, because it incurs
a potential runtime penalty (minimal as it may be)
for the sake of a spurious warning emitted by a
too-smart compiler. Can you figure out some way to
silence the warning without runtime impact? Is there
any GCC-specific way to do it (pragmas, etc.)?

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


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