noloader / cryptopp-pem

PEM parsing of keys and parameters for Crypto++ project
38 stars 31 forks source link

Fix compilation error by some C++20 compilers. #3

Closed Predelnik closed 5 years ago

Predelnik commented 5 years ago

std::unary_function was removed in C++20. Since it may be required only by function object adapters such as std::not1, base class should not matter in this case.

noloader commented 5 years ago

Thanks @Predelnik.

Forgive my ignorance... Will C++03 remain happy? We still see it in the field, like on Red Hat servers with GCC 4.8 (hard to believe in 2018...).

Predelnik commented 5 years ago

Yes it should be fine by C++03 since this function object is used only as an argument to std::transform. This inheritance could matter only in complex cases like using std::not1 (ByteToLower ()) for example. But even for such cases it could be replaced with direct typedefs for argument_type and result_type without inheriting.

More info here: https://en.cppreference.com/w/cpp/utility/functional/unary_function

noloader commented 5 years ago

Thanks @Predelnik. Merged.