lib/curl: add "noexcept"

This commit is contained in:
Max Kellermann
2017-11-12 17:49:58 +01:00
parent c582a9faae
commit 9d47b220a4
14 changed files with 71 additions and 65 deletions

View File

@@ -58,25 +58,26 @@ public:
/**
* Create an empty instance.
*/
CurlEasy(std::nullptr_t):handle(nullptr) {}
CurlEasy(std::nullptr_t) noexcept:handle(nullptr) {}
CurlEasy(CurlEasy &&src):handle(std::exchange(src.handle, nullptr)) {}
CurlEasy(CurlEasy &&src) noexcept
:handle(std::exchange(src.handle, nullptr)) {}
~CurlEasy() {
~CurlEasy() noexcept {
if (handle != nullptr)
curl_easy_cleanup(handle);
}
operator bool() const {
operator bool() const noexcept {
return handle != nullptr;
}
CurlEasy &operator=(CurlEasy &&src) {
CurlEasy &operator=(CurlEasy &&src) noexcept {
std::swap(handle, src.handle);
return *this;
}
CURL *Get() {
CURL *Get() noexcept {
return handle;
}