when checking a functor which is derived from std::unary_function as follows
struct IsInterestingMsg : public std::unary_function<string,bool>
Lint ejects the following info/warnings:
1790: Base class 'std::unary_function<std::basic_string<char>,bool>' has no non-destructor virtual functions
and
Warning 1509: base class destructor for class 'unary_function' is not virtual
According to Scott Meyers, functor classes should be made adaptable by deriving from unary/binary_function
which are basically only a collection of typedefs, thus, they are no classes that need any constructor / destructor. Therefore, the lint warnings are per se correct.
Does anybody know how to suppress these warnings globally and only for all usage of unary_function
etc.? I want to avoid writing an -e1509
every time it's used.
Info #1790 can be suppressed by using private inheritance instead of public, but warning #1509 remains.