diff --git a/test/unittest_stringpair.cc b/test/unittest_stringpair.cc index 6a4e24b..fc565c9 100644 --- a/test/unittest_stringpair.cc +++ b/test/unittest_stringpair.cc @@ -47,7 +47,7 @@ TEST( StringPair, Dynamic ) spl.push_back( pEp::StringPair{key, value} ); } - auto find_by_key = [key](const ::stringpair_t* sp){ return strcmp(sp->key, key)==0; }; + auto find_by_key = [&key](const ::stringpair_t* sp){ return strcmp(sp->key, key)==0; }; // delete random elements. for(unsigned u=0; ukey, key); spl.erase(q); q = std::find_if( spl.begin(), spl.end(), find_by_key );