elastic / ml-cpp

Machine learning C++ code
Other
149 stars 62 forks source link

[ML] Fix lambda capture triggering warning on Windows #2655

Closed edsavage closed 4 months ago

edsavage commented 4 months ago

Windows build logs contain the warning

lib\model\CTokenListDataCategorizerBase.cc(429,1): warning C4573: the usage of 'ml::model::CTokenListDataCategorizerBase::acceptPersistInserter' requires the compiler to capture 'this' but the current default capture mode does not allow it

This PR fixes that by explicitly capturing the "this" pointer.

Relates #2653

edsavage commented 4 months ago

Annoyingly this now produces warnings on other platforms that the "this" pointer capture is not needed. Another way must be found.

edsavage commented 4 months ago

buildkite build this