From 8cd0ed05096e5b446ad1d8818ae68295b49541ea Mon Sep 17 00:00:00 2001 From: Hlado <47942366+Hlado@users.noreply.github.com> Date: Sun, 30 Jun 2024 18:17:00 +0300 Subject: [PATCH] Added move assignment operator to Client class. (#1873) --- httplib.h | 1 + test/test.cc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/httplib.h b/httplib.h index 616b914..ceb5cdf 100644 --- a/httplib.h +++ b/httplib.h @@ -1530,6 +1530,7 @@ public: const std::string &client_key_path); Client(Client &&) = default; + Client &operator=(Client &&) = default; ~Client(); diff --git a/test/test.cc b/test/test.cc index 855988d..446e7f9 100644 --- a/test/test.cc +++ b/test/test.cc @@ -54,11 +54,17 @@ MultipartFormData &get_file_value(MultipartFormDataItems &files, #endif } -TEST(ConstructorTest, MoveConstructible) { +TEST(ClientTest, MoveConstructible) { EXPECT_FALSE(std::is_copy_constructible::value); EXPECT_TRUE(std::is_nothrow_move_constructible::value); } +TEST(ClientTest, MoveAssignable) +{ + EXPECT_FALSE(std::is_copy_assignable::value); + EXPECT_TRUE(std::is_nothrow_move_assignable::value); +} + #ifdef _WIN32 TEST(StartupTest, WSAStartup) { WSADATA wsaData;