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: another effc++ spurious warning?


Matt Austern wrote:

> istream_iterator and ostream_iterator are sort of a special case.

This makes me think: maybe we can disable this warning for system headers? Or
for std::istream_iterator/std::ostream_iterator only (as in, hardcoded as an
exception)?

I think it makes sense in the average case that the operator++(int) returns a
value of the class type rather than a reference. At least, for normal uses of
operator overloading and C++. If you do something more advanced like funky
overloading within complex template metaprogramming (thinking of Boost.Spirit
or similar), you surely don't need -Weffc++, and you are already smart enough
to not need it for any program. But I see beginners getting this kind of things
wrong every other day, so I still think it would be an useful check (in fact,
my personal position on -Weffc++ is that it is a powerful tool for beginners,
but a pain in the neck for the experts).

Giovanni Bajo



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