Skip to content

Commit

Permalink
SqlStmtParameters: cleanup special member functions.
Browse files Browse the repository at this point in the history
The private-but-not-implemented copy constructor is a relic from the
past to make the class non-copyable, but these days we can just make it
public and deleted. That said, I don't really see a compelling reason to
make this non-copyable.

I also see no reason to explicitly add a default destructor given this
class is not a base class. That way, it nicely follows the so called
"rule of zero" (or the C++ core guideline "if you can avoid defining
default operations, do").

This also avoids a bunch of [-Wdeprecated-copy] GCC/clang compiler
warnings when using recent versions, because an implicitly declared copy
constructor (which is actually used, for example in SqlStatement's copy
constructor) is deprecated when you have the copy assignment declared.
  • Loading branch information
evil-at-wow authored and killerwife committed Sep 27, 2023
1 parent 70e1611 commit 322afd0
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/shared/Database/SqlPreparedStatement.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ class SqlStmtParameters
// reserve memory to contain all input parameters of stmt
explicit SqlStmtParameters(uint32 nParams);

~SqlStmtParameters() {}

// get amount of bound parameters
uint32 boundParams() const { return m_params.size(); }
// add parameter
Expand All @@ -162,8 +160,6 @@ class SqlStmtParameters
const ParameterContainer& params() const { return m_params; }

private:
SqlStmtParameters& operator=(const SqlStmtParameters& obj);

// statement parameter holder
ParameterContainer m_params;
};
Expand Down

0 comments on commit 322afd0

Please sign in to comment.