Skip to content

Commit 173a511

Browse files
authored
Merge pull request #11303 from ethereum/noncopyable
Remove the usage of boost::noncopyable
2 parents 9439ff8 + e394331 commit 173a511

20 files changed

+70
-38
lines changed

libevmasm/SimplificationRules.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
#include <libsolutil/CommonData.h>
3131

32-
#include <boost/noncopyable.hpp>
33-
3432
#include <functional>
3533
#include <vector>
3634

@@ -47,9 +45,13 @@ class Pattern;
4745
/**
4846
* Container for all simplification rules.
4947
*/
50-
class Rules: public boost::noncopyable
48+
class Rules
5149
{
5250
public:
51+
/// Noncopyable.
52+
Rules(Rules const&) = delete;
53+
Rules& operator=(Rules const&) = delete;
54+
5355
using Expression = ExpressionClasses::Expression;
5456

5557
Rules();

libsmtutil/CVC4Interface.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include <libsmtutil/SolverInterface.h>
22-
#include <boost/noncopyable.hpp>
2322

2423
#if defined(__GLIBC__)
2524
// The CVC4 headers includes the deprecated system headers <ext/hash_map>
@@ -37,9 +36,13 @@
3736
namespace solidity::smtutil
3837
{
3938

40-
class CVC4Interface: public SolverInterface, public boost::noncopyable
39+
class CVC4Interface: public SolverInterface
4140
{
4241
public:
42+
/// Noncopyable.
43+
CVC4Interface(CVC4Interface const&) = delete;
44+
CVC4Interface& operator=(CVC4Interface const&) = delete;
45+
4346
CVC4Interface(std::optional<unsigned> _queryTimeout = {});
4447

4548
void reset() override;

libsmtutil/SMTLib2Interface.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <libsolutil/Common.h>
2626
#include <libsolutil/FixedHash.h>
2727

28-
#include <boost/noncopyable.hpp>
2928
#include <cstdio>
3029
#include <map>
3130
#include <set>
@@ -35,9 +34,13 @@
3534
namespace solidity::smtutil
3635
{
3736

38-
class SMTLib2Interface: public SolverInterface, public boost::noncopyable
37+
class SMTLib2Interface: public SolverInterface
3938
{
4039
public:
40+
/// Noncopyable.
41+
SMTLib2Interface(SMTLib2Interface const&) = delete;
42+
SMTLib2Interface& operator=(SMTLib2Interface const&) = delete;
43+
4144
explicit SMTLib2Interface(
4245
std::map<util::h256, std::string> _queryResponses = {},
4346
frontend::ReadCallback::Callback _smtCallback = {},

libsmtutil/SMTPortfolio.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <libsolidity/interface/ReadFile.h>
2424
#include <libsolutil/FixedHash.h>
2525

26-
#include <boost/noncopyable.hpp>
2726
#include <map>
2827
#include <vector>
2928

@@ -36,9 +35,13 @@ namespace solidity::smtutil
3635
* It also checks whether different solvers give conflicting answers
3736
* to SMT queries.
3837
*/
39-
class SMTPortfolio: public SolverInterface, public boost::noncopyable
38+
class SMTPortfolio: public SolverInterface
4039
{
4140
public:
41+
/// Noncopyable.
42+
SMTPortfolio(SMTPortfolio const&) = delete;
43+
SMTPortfolio& operator=(SMTPortfolio const&) = delete;
44+
4245
SMTPortfolio(
4346
std::map<util::h256, std::string> _smtlib2Responses = {},
4447
frontend::ReadCallback::Callback _smtCallback = {},

libsmtutil/SolverInterface.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#include <libsolutil/Common.h>
2525

26-
#include <boost/noncopyable.hpp>
2726
#include <cstdio>
2827
#include <map>
2928
#include <memory>

libsmtutil/Z3Interface.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@
1919
#pragma once
2020

2121
#include <libsmtutil/SolverInterface.h>
22-
#include <boost/noncopyable.hpp>
2322
#include <z3++.h>
2423

2524
namespace solidity::smtutil
2625
{
2726

28-
class Z3Interface: public SolverInterface, public boost::noncopyable
27+
class Z3Interface: public SolverInterface
2928
{
3029
public:
30+
/// Noncopyable.
31+
Z3Interface(Z3Interface const&) = delete;
32+
Z3Interface& operator=(Z3Interface const&) = delete;
33+
3134
Z3Interface(std::optional<unsigned> _queryTimeout = {});
3235

3336
static bool available();

libsolidity/analysis/DeclarationContainer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <libsolidity/ast/ASTForward.h>
2727
#include <liblangutil/Exceptions.h>
2828
#include <liblangutil/SourceLocation.h>
29-
#include <boost/noncopyable.hpp>
3029

3130
namespace solidity::frontend
3231
{

libsolidity/analysis/DeclarationTypeChecker.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <libsolidity/ast/ASTAnnotations.h>
2323
#include <liblangutil/EVMVersion.h>
2424

25-
#include <boost/noncopyable.hpp>
2625
#include <list>
2726
#include <map>
2827

libsolidity/analysis/GlobalContext.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#pragma once
2525

2626
#include <libsolidity/ast/ASTForward.h>
27-
#include <boost/noncopyable.hpp>
2827
#include <map>
2928
#include <memory>
3029
#include <string>
@@ -41,9 +40,13 @@ class Type; // forward
4140
* @note must not be destroyed or moved during compilation as its objects can be referenced from
4241
* other objects.
4342
*/
44-
class GlobalContext: private boost::noncopyable
43+
class GlobalContext
4544
{
4645
public:
46+
/// Noncopyable.
47+
GlobalContext(GlobalContext const&) = delete;
48+
GlobalContext& operator=(GlobalContext const&) = delete;
49+
4750
GlobalContext();
4851
void setCurrentContract(ContractDefinition const& _contract);
4952
void resetCurrentContract() { m_currentContract = nullptr; }

libsolidity/analysis/NameAndTypeResolver.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131

3232
#include <liblangutil/EVMVersion.h>
3333

34-
#include <boost/noncopyable.hpp>
35-
3634
#include <list>
3735
#include <map>
3836

@@ -48,9 +46,13 @@ namespace solidity::frontend
4846
* Resolves name references, typenames and sets the (explicitly given) types for all variable
4947
* declarations.
5048
*/
51-
class NameAndTypeResolver: private boost::noncopyable
49+
class NameAndTypeResolver
5250
{
5351
public:
52+
/// Noncopyable.
53+
NameAndTypeResolver(NameAndTypeResolver const&) = delete;
54+
NameAndTypeResolver& operator=(NameAndTypeResolver const&) = delete;
55+
5456
/// Creates the resolver with the given declarations added to the global scope.
5557
/// @param _scopes mapping of scopes to be used (usually default constructed), these
5658
/// are filled during the lifetime of this object.

0 commit comments

Comments
 (0)