[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#196754: Implicit Conversion Allowed in Container Object Insertion



Package: libstdc++5-dev
Version: 3.2.3-4
Severity: wishlist
Tags: upstream

/usr/include/c++/3.2/bits/stl_vector.h:893: no matching function for call to `Field::Field(const Field&)'

...where ...

/usr/include/c++/3.2/bits/stl_vector.h:893:
_Tp __x_copy = __x;

... the intended constructor is ...

explicit Field( Field const & f)

... the difficulty can be resolved by the user code not having an explicit constructor...

Field( Field const & f)

...or by not using an implicit conversion...

/usr/include/c++/3.2/bits/stl_vector.h:893:
_Tp __x_copy(__x);

I believe the explicit constructor should be preferred.








Reply to: