HomePhabricator

[backport#15308] Piecewise construct to avoid invalid construction

Description

[backport#15308] Piecewise construct to avoid invalid construction

Summary:
In CMainSignals::RegisterWithMempoolSignals running under Ubuntu 14.04
(QT 5.2), absent piecewise construction this fails to create the pair
because the argument is a connection, which is converted into a
non-copyable scoped_connection.

validationinterface.cpp:80:186:   required from here
/usr/include/boost/signals2/connection.hpp:234:7: error: ‘boost::signals2::scoped_connection::scoped_connection(const boost::signals2::scoped_connection&)’ is private
       scoped_connection(const scoped_connection &other);
       ^
In file included from /usr/include/c++/4.8/utility:70:0,
                 from /usr/include/c++/4.8/algorithm:60,
                 from ./prevector.h:13,
                 from ./script/script.h:10,
                 from ./primitives/transaction.h:11,
                 from ./validationinterface.h:9,
                 from validationinterface.cpp:6:
/usr/include/c++/4.8/bits/stl_pair.h:134:45: error: within this context
  : first(std::forward<_U1>(__x)), second(__y) { }

https://travis-ci.org/bitcoin/bitcoin/jobs/473689141#L2172


This is a partial backport of Core PR15308

Test Plan:

ninja check

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D6148

Details

Provenance
Ben Woosley <ben.woosley@gmail.com>Authored on Dec 30 2018, 22:19
majcostaCommitted on May 20 2020, 14:37
majcostaPushed on May 20 2020, 14:37
Reviewer
Restricted Project
Differential Revision
D6148: [backport#15308] Piecewise construct to avoid invalid construction
Parents
rABC5ab3f9d832ed: [backport#14820] test: Fix descriptor_tests not checking ToString output of…
Branches
Unknown
Tags
Unknown