[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master c4203a5 4/5: Capture "this" object explicitly
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master c4203a5 4/5: Capture "this" object explicitly to fix C++20 build |
Date: |
Thu, 14 May 2020 17:33:11 -0400 (EDT) |
branch: master
commit c4203a5153b943611473892d64b7fbc87eec6379
Author: Vadim Zeitlin <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Capture "this" object explicitly to fix C++20 build
Capturing "this" implicitly due to the use of "=" capture mode is
deprecated in C++20 and it must be explicitly captured either by
reference ("this") or by value/copy ("*this").
Clarify what is meant in the code by capturing it explicitly and also
getting rid of the implicit capture completely.
---
pdf_command_wx.cpp | 2 +-
rate_table.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/pdf_command_wx.cpp b/pdf_command_wx.cpp
index 96cb575..83be524 100644
--- a/pdf_command_wx.cpp
+++ b/pdf_command_wx.cpp
@@ -2455,7 +2455,7 @@ class page_with_basic_tabular_report : public
page_with_tabular_report
// PDF !! This member is already a const reference, so why
// declare a const reference to it?
auto const& z = interpolator_;
- auto const output_two_column_super_header = [=,&table_gen]
+ auto const output_two_column_super_header =
[this,pos_y,output_mode,z,&table_gen]
(basis guar_or_curr
,interest_rate zero_or_not
,int begin_column
diff --git a/rate_table.cpp b/rate_table.cpp
index 90ec1de..c410cfc 100644
--- a/rate_table.cpp
+++ b/rate_table.cpp
@@ -1656,7 +1656,7 @@ void table_impl::parse_values(std::istream& is, int&
line_num)
// Initialize this variable using a lambda with a switch inside just to
// make sure this code gets updated if any new table types are added.
- auto const is_select_table = [=]() {
+ auto const is_select_table = [this]() {
switch(*type_) {
case table_type::aggregate:
case table_type::duration: