kaldi icon indicating copy to clipboard operation
kaldi copied to clipboard

Remove use of `std::unary_function`

Open h-vetinari opened this issue 3 years ago • 3 comments

This facility has been deprecated in C++11 and was removed in C++17. In particular, this means the code as-is currently doesn't compile with C++17, which can be problematic because that's often a necessary work-around for CUDA on windows, cf. e.g. https://github.com/microsoft/STL/issues/2020.

h-vetinari avatar Apr 20 '22 22:04 h-vetinari

Do you have time to try just removing the inheritance from std::unary_function, where it occurs, and seeing whether it affects compilation? It may not even be necessary.

mac:kaldi: git grep unary_function
misc/maintenance/cpplint.py:    ('<functional>', ('unary_function', 'binary_function',
misc/maintenance/cpplint.py:                      'pointer_to_unary_function',
src/lm/arpa-lm-compiler.cc:  struct HashType : public std::unary_function<GeneralHistKey, size_t> {
src/lm/arpa-lm-compiler.cc:  struct HashType : public std::unary_function<OptimizedHistKey, size_t> {
src/nnet3/nnet-compile-utils-test.cc:struct ComparePair : public std::unary_function<std::pair<int32, int32>, bool>
src/nnet3/nnet-compile-utils-test.cc:    public std::unary_function<std::pair<int32, int32>, bool>

danpovey avatar Apr 21 '22 03:04 danpovey

This issue has been automatically marked as stale by a bot solely because it has not had recent activity. Please add any comment (simply 'ping' is enough) to prevent the issue from being closed for 60 more days if you believe it should be kept open.

stale[bot] avatar Jun 23 '22 00:06 stale[bot]

should keep this open

danpovey avatar Jun 23 '22 03:06 danpovey