Skip to content

Commit df134ac

Browse files
author
Daniel Kroening
committed
add noexcept to frequently used constructors
1 parent 0c20014 commit df134ac

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/big-int/bigint.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ BigInt::BigInt (BigInt const &y)
464464
memcpy (digit, y.digit, length * sizeof (onedig_t));
465465
}
466466

467-
BigInt::BigInt (BigInt &&y)
467+
BigInt::BigInt (BigInt &&y) noexcept
468468
: BigInt()
469469
{
470470
swap(y);

src/big-int/bigint.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public:
168168
BigInt (llong_t) _fast;
169169
BigInt (ullong_t) _fast;
170170
BigInt (BigInt const &) _fast;
171-
BigInt (BigInt &&) _fast;
171+
BigInt (BigInt &&) noexcept _fast;
172172
BigInt (char const *, onedig_t = 10) _fast;
173173

174174
BigInt &operator= (BigInt const &) _fast;

src/util/dstring.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class dstringt final
2525
#ifdef __GNUC__
2626
constexpr
2727
#endif
28-
dstringt():no(0)
28+
dstringt() noexcept:no(0)
2929
{
3030
}
3131

src/util/expr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class exprt:public irept
4545
typedef std::vector<exprt> operandst;
4646

4747
// constructors
48-
exprt() { }
48+
exprt() noexcept { }
4949
explicit exprt(const irep_idt &_id):irept(_id) { }
5050
exprt(const irep_idt &_id, const typet &_type):irept(_id)
5151
{

src/util/irep.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class irept
103103
bool is_nil() const { return id()==ID_nil; }
104104
bool is_not_nil() const { return id()!=ID_nil; }
105105

106-
explicit irept(const irep_idt &_id)
106+
explicit irept(const irep_idt &_id) noexcept
107107
#ifdef SHARING
108108
:data(&empty_d)
109109
#endif
@@ -113,12 +113,12 @@ class irept
113113

114114
#ifdef SHARING
115115
// constructor for blank irep
116-
irept():data(&empty_d)
116+
irept() noexcept:data(&empty_d)
117117
{
118118
}
119119

120120
// copy constructor
121-
irept(const irept &irep):data(irep.data)
121+
irept(const irept &irep) noexcept:data(irep.data)
122122
{
123123
if(data!=&empty_d)
124124
{
@@ -135,7 +135,7 @@ class irept
135135
// Copy from rvalue reference.
136136
// Note that this does avoid a branch compared to the
137137
// standard copy constructor above.
138-
irept(irept &&irep):data(irep.data)
138+
irept(irept &&irep) noexcept:data(irep.data)
139139
{
140140
#ifdef IREP_DEBUG
141141
std::cout << "COPY MOVE\n";
@@ -165,7 +165,7 @@ class irept
165165
#ifdef USE_MOVE
166166
// Note that the move assignment operator does avoid
167167
// three branches compared to standard operator above.
168-
irept &operator=(irept &&irep)
168+
irept &operator=(irept &&irep) noexcept
169169
{
170170
#ifdef IREP_DEBUG
171171
std::cout << "ASSIGN MOVE\n";

0 commit comments

Comments
 (0)