Skip to content

Commit

Permalink
Get rid of explicit copy constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
attah committed Feb 1, 2024
1 parent 1e478f6 commit 573055a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
12 changes: 0 additions & 12 deletions lib/ippprintjob.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ class IppPrintJob

List<std::string> additionalDocumentFormats();

IppPrintJob& operator=(const IppPrintJob& other)
{
opAttrs = other.opAttrs;
jobAttrs = other.jobAttrs;
printParams = other.printParams;
_printerAttrs = other._printerAttrs;
targetFormat = other.targetFormat;
oneStage = other.oneStage;
margins = other.margins;
return *this;
};

typedef std::pair<std::string, std::string> ConvertKey;
typedef std::function<Error(std::string inFileName, WriteFun writeFun, const IppPrintJob& job, ProgressFun progressFun, bool verbose)> ConvertFun;

Expand Down
9 changes: 8 additions & 1 deletion lib/setting.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
template <typename T>
class Setting
{
// Settings must be immune to copying/assignment,
// so they keep pointing to the Attrs of their parent IppPrintJob.
// Thus, no need to expose copying/assignment to anything else.
protected:
friend class IppPrintJob;
Setting(Setting&) {}
Setting& operator=(const Setting&) {return *this;};

public:
Setting() = delete;
Setting& operator=(const Setting& other) = delete;
Setting(IppAttrs* printerAttrs, IppAttrs* attrs, IppMsg::Tag tag, std::string name, std::string subKey = "")
: _printerAttrs(printerAttrs), _attrs(attrs), _tag(tag), _name(name), _subKey(subKey)
{}
Expand Down

0 comments on commit 573055a

Please sign in to comment.