Skip to content

Commit

Permalink
Added default copy assignment operators where their implicit definiti…
Browse files Browse the repository at this point in the history
…on is now (C++11) deprecated due to the presence of user-declared copy constructors.
  • Loading branch information
pkeir authored and zayenz committed Oct 13, 2021
1 parent 0749349 commit a15997f
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gecode/flatzinc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,8 @@ namespace Gecode { namespace FlatZinc {
unsigned int a, int i, const FloatNumBranch& nl,
std::ostream& o) const;
#endif
/// Assignment operator
BranchInformation& operator =(const BranchInformation&) = default;
};

/// Uninitialized default random number generator
Expand Down
6 changes: 6 additions & 0 deletions gecode/float.hh
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,9 @@ namespace Gecode {
/// Test whether \a n is contained in domain
bool in(const FloatVal& n) const;
//@}

/// Assignment operator
FloatVar& operator =(const FloatVar&) = default;
};

/**
Expand Down Expand Up @@ -1053,6 +1056,9 @@ namespace Gecode {
GECODE_FLOAT_EXPORT
FloatVarArray(Space& home, int n, FloatNum min, FloatNum max);
//@}

/// Assignment operator
FloatVarArray& operator =(const FloatVarArray&) = default;
};

}
Expand Down
15 changes: 15 additions & 0 deletions gecode/int.hh
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ namespace Gecode {
/// Test whether \a n is contained in domain
bool in(int n) const;
//@}

/// Assignment operator
IntVar& operator =(const IntVar&) = default;
};

/**
Expand Down Expand Up @@ -588,6 +591,9 @@ namespace Gecode {
/// Test whether domain is neither zero nor one
bool none(void) const;
//@}

/// Assignment operator
BoolVar& operator =(const BoolVar&) = default;
};

/**
Expand Down Expand Up @@ -699,6 +705,9 @@ namespace Gecode {
GECODE_INT_EXPORT
IntVarArgs(Space& home, int n, const IntSet& s);
//@}

/// Assignment operator
IntVarArgs& operator =(const IntVarArgs&) = default;
};

/** \brief Passing Boolean variables
Expand Down Expand Up @@ -799,6 +808,9 @@ namespace Gecode {
GECODE_INT_EXPORT
IntVarArray(Space& home, int n, const IntSet& s);
//@}

/// Assignment operator
IntVarArray& operator =(const IntVarArray&) = default;
};

/**
Expand Down Expand Up @@ -831,6 +843,9 @@ namespace Gecode {
GECODE_INT_EXPORT
BoolVarArray(Space& home, int n, int min, int max);
//@}

/// Assignment operator
BoolVarArray& operator =(const BoolVarArray&) = default;
};

}
Expand Down
6 changes: 6 additions & 0 deletions gecode/kernel/data/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,9 @@ namespace Gecode {
friend
typename ArrayTraits<ArgArray<T>>::ArgsType
operator + <>(const T& x, const ArgArray<T>& y);

/// Assignment operator
ArgArray& operator =(const ArgArray&) = default;
};

template<class> class VarArgArray;
Expand Down Expand Up @@ -825,6 +828,9 @@ namespace Gecode {
friend
typename ArrayTraits<VarArgArray<Var>>::ArgsType
operator + <>(const Var& x, const VarArgArray<Var>& y);

/// Assignment operator
VarArgArray& operator =(const VarArgArray&) = default;
};


Expand Down
3 changes: 3 additions & 0 deletions gecode/kernel/data/shared-array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ namespace Gecode {
/// Return a reverse and read-only iterator past the beginning of the array
const_reverse_iterator rend(void) const;
//@}

/// Assignment operator
SharedArray& operator =(const SharedArray&) = default;
};

/**
Expand Down
6 changes: 6 additions & 0 deletions gecode/set.hh
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ namespace Gecode {
/// Test whether \a i is not in the least upper bound
bool notContains(int i) const;
//@}

/// Assignment operator
SetVar& operator =(const SetVar&) = default;
};

/**
Expand Down Expand Up @@ -621,6 +624,9 @@ namespace Gecode {
unsigned int minCard = 0,
unsigned int maxCard = Set::Limits::card);
//@}

/// Assignment operator
SetVarArray& operator =(const SetVarArray&) = default;
};

}
Expand Down

0 comments on commit a15997f

Please sign in to comment.