From 60c69df968d1c72c998cd5f23ba34e2e3718a84b Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 9 Mar 2020 19:17:50 +0300 Subject: [PATCH] Silence C++20 warning --- include/cereal/cereal.hpp | 4 ++-- include/cereal/types/memory.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/cereal/cereal.hpp b/include/cereal/cereal.hpp index 09857820..750fb23b 100644 --- a/include/cereal/cereal.hpp +++ b/include/cereal/cereal.hpp @@ -454,7 +454,7 @@ namespace cereal template inline ArchiveType & processImpl(DeferredData const & d) { - std::function deferment( [=](){ self->process( d.value ); } ); + std::function deferment( [=, this](){ self->process( d.value ); } ); itsDeferments.emplace_back( std::move(deferment) ); return *self; @@ -859,7 +859,7 @@ namespace cereal template inline ArchiveType & processImpl(DeferredData const & d) { - std::function deferment( [=](){ self->process( d.value ); } ); + std::function deferment( [=, this](){ self->process( d.value ); } ); itsDeferments.emplace_back( std::move(deferment) ); return *self; diff --git a/include/cereal/types/memory.hpp b/include/cereal/types/memory.hpp index 59e9da9b..fbb2a090 100644 --- a/include/cereal/types/memory.hpp +++ b/include/cereal/types/memory.hpp @@ -297,7 +297,7 @@ namespace cereal // uninitialized until initialized with placement new using NonConstT = typename std::remove_const::type; std::shared_ptr ptr(reinterpret_cast(new ST()), - [=]( NonConstT * t ) + [=, this]( NonConstT * t ) { if( *valid ) t->~T();