Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-tidy: use = delete #1593

Merged
merged 1 commit into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions samples/Jzon.h
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ namespace Jzon
// Return result from last call to Write()
const std::string &GetResult() const;

// Disable assignment operator
Writer &operator=(const Writer&) = delete;
private:
void writeNode(const Node &node, unsigned int level);
void writeObject(const Object &node, unsigned int level);
Expand All @@ -404,9 +406,6 @@ namespace Jzon
class FormatInterpreter *fi;

const Node &root;

// Disable assignment operator
Writer &operator=(const Writer&);
};

class JzonAPI Parser
Expand All @@ -421,6 +420,8 @@ namespace Jzon

const std::string &GetError() const;

// Disable assignment operator
Parser &operator=(const Parser&) = delete;
private:
enum Token
{
Expand Down Expand Up @@ -455,9 +456,6 @@ namespace Jzon
Node &root;

std::string error;

// Disable assignment operator
Parser &operator=(const Parser&);
};
}

Expand Down
25 changes: 10 additions & 15 deletions src/basicio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,9 @@ namespace Exiv2 {
// Windows function to determine the number of hardlinks (on NTFS)
DWORD winNumberOfLinks() const;
#endif

private:
// NOT IMPLEMENTED
Impl(const Impl& rhs); //!< Copy constructor
Impl& operator=(const Impl& rhs); //!< Assignment

Impl(const Impl& rhs) = delete; //!< Copy constructor
Impl& operator=(const Impl& rhs) = delete; //!< Assignment
}; // class FileIo::Impl

FileIo::Impl::Impl(const std::string& path)
Expand Down Expand Up @@ -1063,11 +1060,9 @@ namespace Exiv2 {
// METHODS
void reserve(long wcount); //!< Reserve memory

private:
// NOT IMPLEMENTED
Impl(const Impl& rhs); //!< Copy constructor
Impl& operator=(const Impl& rhs); //!< Assignment

Impl(const Impl& rhs) = delete; //!< Copy constructor
Impl& operator=(const Impl& rhs) = delete; //!< Assignment
}; // class MemIo::Impl

MemIo::Impl::Impl()
Expand Down Expand Up @@ -2063,10 +2058,10 @@ namespace Exiv2 {
@throw Error if it fails.
*/
void writeRemote(const byte* data, size_t size, long from, long to);
protected:

// NOT IMPLEMENTED
HttpImpl(const HttpImpl& rhs); //!< Copy constructor
HttpImpl& operator=(const HttpImpl& rhs); //!< Assignment
HttpImpl(const HttpImpl& rhs) = delete; //!< Copy constructor
HttpImpl& operator=(const HttpImpl& rhs) = delete; //!< Assignment
}; // class HttpIo::HttpImpl

HttpIo::HttpImpl::HttpImpl(const std::string& url, size_t blockSize):Impl(url, blockSize)
Expand Down Expand Up @@ -2233,10 +2228,10 @@ namespace Exiv2 {
http://dev.exiv2.org/wiki/exiv2
*/
void writeRemote(const byte* data, size_t size, long from, long to);
protected:

// NOT IMPLEMENTED
CurlImpl(const CurlImpl& rhs); //!< Copy constructor
CurlImpl& operator=(const CurlImpl& rhs); //!< Assignment
CurlImpl(const CurlImpl& rhs) = delete; //!< Copy constructor
CurlImpl& operator=(const CurlImpl& rhs) = delete; //!< Assignment
private:
long timeout_; //!< The number of seconds to wait while trying to connect.
}; // class RemoteIo::Impl
Expand Down