]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
server : use lambda instead of std::bind (#11507)
authorDaniel Bevenius <redacted>
Thu, 30 Jan 2025 10:05:00 +0000 (11:05 +0100)
committerGitHub <redacted>
Thu, 30 Jan 2025 10:05:00 +0000 (11:05 +0100)
commit4314e56c4f8c5091f45732f39bd94c0c6c323798
treeee20ac7beeb058db9d1b5349e8620a48d70a1370
parent496e5bf46bab757d05e18227cb4e17055ae42f42
server : use lambda instead of std::bind (#11507)

This commit replaces the two usages of `std::bind` in favor of lambdas for
the callback functions for `callback_new_task` and
`callback_update_slots`.

The motivation for this changes is consistency with the rest of the code
in server.cpp (lambdas are used for all other callbacks/handlers). Also
lambdas are more readable (perhaps this is subjective) but also they are
recommended over `std::bind` in modern C++.

Ref: https://github.com/LithoCoders/dailycpp/blob/master/EffectiveModernC%2B%2B/chapter6/Item34_Prefer_lambdas_to_std::bind.md
examples/server/server.cpp