Skip to content

Commit

Permalink
[cpp20] explicitly capture 'this' as copy (#640)
Browse files Browse the repository at this point in the history
implicit 'this' capture is deprecated in C++20
  • Loading branch information
lukaszgemborowski authored Apr 23, 2020
1 parent 10d9a29 commit 3e4d1b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/cereal/cereal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ namespace cereal
template <class T> inline
ArchiveType & processImpl(DeferredData<T> const & d)
{
std::function<void(void)> deferment( [=](){ self->process( d.value ); } );
std::function<void(void)> deferment( [this, d](){ self->process( d.value ); } );
itsDeferments.emplace_back( std::move(deferment) );

return *self;
Expand Down Expand Up @@ -859,7 +859,7 @@ namespace cereal
template <class T> inline
ArchiveType & processImpl(DeferredData<T> const & d)
{
std::function<void(void)> deferment( [=](){ self->process( d.value ); } );
std::function<void(void)> deferment( [this, d](){ self->process( d.value ); } );
itsDeferments.emplace_back( std::move(deferment) );

return *self;
Expand Down

0 comments on commit 3e4d1b8

Please sign in to comment.