Port to C++ delete keyword

Performed using modernize-use-equals-delete from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-equals-delete.html
time-shift
Sébastien Villemot 2019-01-09 16:23:04 +01:00
parent 197cbea919
commit 7df31f68d9
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
7 changed files with 11 additions and 17 deletions

View File

@ -357,6 +357,7 @@ namespace ogp
}
VarOrdering(const VarOrdering &vo, const vector<const char *> &vnames,
const DynamicAtoms &a);
VarOrdering(const VarOrdering &vo) = delete;
virtual VarOrdering *clone(const vector<const char *> &vnames,
const DynamicAtoms &a) const = 0;
/** Destructor does nothing here. */
@ -462,9 +463,6 @@ namespace ogp
* from the least to the most time preserving the order of atoms
* within one time. */
void do_increasing_time();
private:
/** Declare this copy constructor as private to hide it. */
VarOrdering(const VarOrdering &vo);
};
};

View File

@ -158,6 +158,7 @@ namespace ogp
: atoms(a)
{
}
FormulaParser(const FormulaParser &fp) = delete;
/** Copy constructor using a different instance of Atoms. */
FormulaParser(const FormulaParser &fp, Atoms &a);
virtual
@ -295,9 +296,6 @@ namespace ogp
/** Debug print. */
void print() const;
private:
/** Hide this copy constructor declaration by declaring it as
* private. */
FormulaParser(const FormulaParser &fp);
/** Destroy all derivatives. */
void destroy_derivatives();
};

View File

@ -403,6 +403,7 @@ namespace ogp
* will contain only formulas up to the given last index
* (included). */
EvalTree(const OperationTree &otree, int last = -1);
EvalTree(const EvalTree &) = delete;
virtual ~EvalTree()
{
delete [] values; delete [] flags;
@ -422,8 +423,6 @@ namespace ogp
{
return otree;
}
private:
EvalTree(const EvalTree &);
};
/** This is an interface describing how a given operation is

View File

@ -47,6 +47,7 @@ namespace ogdyn
* function. This will save us many occurrences of other
* variables involved in the equation. */
ForwSubstBuilder(DynareModel &m);
ForwSubstBuilder(const ForwSubstBuilder &b) = delete;
/** Copy constructor with a new instance of the model. */
ForwSubstBuilder(const ForwSubstBuilder &b, DynareModel &m);
/** Return the auxiliary variable mapping. */
@ -62,7 +63,6 @@ namespace ogdyn
return info;
}
private:
ForwSubstBuilder(const ForwSubstBuilder &b);
/** This method takes a nonlinear term t, and if it has leads
* of greater than 1, then it substitutes the term for the new
* variable (or string of variables). Note that the

View File

@ -234,6 +234,8 @@ namespace ogdyn
/** Construct a copy of the builder with provided model, which
* is supposed to be the copy of the model in the builder. */
PlannerBuilder(const PlannerBuilder &pb, ogdyn::DynareModel &m);
/** Avoid copying from only PlannerBuilder. */
PlannerBuilder(const PlannerBuilder &pb) = delete;
/** Return the information. */
const PlannerInfo &
get_info() const
@ -272,8 +274,6 @@ namespace ogdyn
* aux_map_static. */
void fill_aux_map(const ogp::NameStorage &ns, const Tsubstmap &aaux_map,
const Tsubstmap &astatic_aux_map);
/** Avoid copying from only PlannerBuilder. */
PlannerBuilder(const PlannerBuilder &pb);
};
/** This class only calculates for the given initial guess of

View File

@ -33,10 +33,10 @@ class SylvMemoryPool
size_t length{0};
size_t allocated{0};
bool stack_mode{false};
SylvMemoryPool(const SylvMemoryPool &);
const SylvMemoryPool &operator=(const SylvMemoryPool &);
public:
SylvMemoryPool();
SylvMemoryPool(const SylvMemoryPool &) = delete;
const SylvMemoryPool &operator=(const SylvMemoryPool &) = delete;
~SylvMemoryPool();
void init(size_t size);
void *allocate(size_t size);
@ -47,11 +47,11 @@ public:
class SylvMemoryDriver
{
SylvMemoryDriver(const SylvMemoryDriver &);
const SylvMemoryDriver &operator=(const SylvMemoryDriver &);
public:
SylvMemoryDriver(int num_d, int m, int n, int order);
SylvMemoryDriver(const SylvParams &pars, int num_d, int m, int n, int order);
SylvMemoryDriver(const SylvMemoryDriver &) = delete;
const SylvMemoryDriver &operator=(const SylvMemoryDriver &) = delete;
static void setStackMode(bool);
~SylvMemoryDriver();
protected:

View File

@ -101,6 +101,7 @@ class IrregTensorHeader
IntSequence end_seq;
public:
IrregTensorHeader(const StackProduct<FGSTensor> &sp, const IntSequence &c);
IrregTensorHeader(const IrregTensorHeader &) = delete;
~IrregTensorHeader();
int
dimen() const
@ -109,8 +110,6 @@ public:
}
void increment(IntSequence &v) const;
int calcMaxOffset() const;
private:
IrregTensorHeader(const IrregTensorHeader &);
};
/* Here we declare the irregular tensor. There is no special logic