From 393db2490b8e7fbe0dbe80b8020ac45d9701d00d Mon Sep 17 00:00:00 2001 From: Davis King Date: Sun, 6 Sep 2020 08:57:44 -0400 Subject: [PATCH] switch this to C++11 code --- dlib/test/metaprogramming.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlib/test/metaprogramming.cpp b/dlib/test/metaprogramming.cpp index c830dcdff..84dea14d1 100644 --- a/dlib/test/metaprogramming.cpp +++ b/dlib/test/metaprogramming.cpp @@ -98,7 +98,8 @@ namespace // make sure stateful lambdas are modified when called value = 0; - auto stateful = [&value, i = value]() mutable { ++i; value = i; }; + int i = 0; + auto stateful = [&value, i]() mutable { ++i; value = i; }; DLIB_TEST(call_if_valid(stateful)); DLIB_TEST(value == 1); DLIB_TEST(call_if_valid(stateful));