瀏覽代碼

refactor: mutable lambda for index

Sam Jaffe 1 年之前
父節點
當前提交
3edfbe2a66
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      include/jvalidate/detail/simple_adapter.h

+ 1 - 2
include/jvalidate/detail/simple_adapter.h

@@ -189,8 +189,7 @@ public:
       }
       }
 
 
       bool rval = true;
       bool rval = true;
-      size_t index = 0;
-      rhs.apply_array([&, this](adapter::Adapter const & elem) {
+      rhs.apply_array([&, this, index = 0UL](adapter::Adapter const & elem) mutable {
         // Short-Circuit OK
         // Short-Circuit OK
         rval = rval && array[index].equals(elem, strict);
         rval = rval && array[index].equals(elem, strict);
         ++index;
         ++index;