1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-04 08:00:59 +01:00

Cleanup: Use C++23 "explicit this" for recursive lambdas

Try to pass by reference where possible.

Co-authored-by: Sergei Zimmerman <sergei@zimmerman.foo>
This commit is contained in:
Eelco Dolstra 2025-10-29 15:17:37 +01:00 committed by John Ericson
parent 3b2186e1c8
commit 1507843f6c
15 changed files with 60 additions and 112 deletions

View file

@ -9,8 +9,7 @@ NixStringContextElem NixStringContextElem::parse(std::string_view s0, const Expe
{
std::string_view s = s0;
std::function<SingleDerivedPath()> parseRest;
parseRest = [&]() -> SingleDerivedPath {
auto parseRest = [&](this auto & parseRest) -> SingleDerivedPath {
// Case on whether there is a '!'
size_t index = s.find("!");
if (index == std::string_view::npos) {