Skip to content

Commit e1efa33

Browse files
authored
Make Client move-constructible (yhirose#1051)
1 parent 549cdf2 commit e1efa33

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

httplib.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,8 @@ class Client {
11611161
const std::string &client_cert_path,
11621162
const std::string &client_key_path);
11631163

1164+
Client(Client &&) = default;
1165+
11641166
~Client();
11651167

11661168
bool is_valid() const;

test/test.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <sstream>
99
#include <stdexcept>
1010
#include <thread>
11+
#include <type_traits>
1112

1213
#define SERVER_CERT_FILE "./cert.pem"
1314
#define SERVER_CERT2_FILE "./cert2.pem"
@@ -40,6 +41,11 @@ MultipartFormData &get_file_value(MultipartFormDataItems &files,
4041
throw std::runtime_error("invalid mulitpart form data name error");
4142
}
4243

44+
TEST(ConstructorTest, MoveConstructible) {
45+
EXPECT_FALSE(std::is_copy_constructible<Client>::value);
46+
EXPECT_TRUE(std::is_nothrow_move_constructible<Client>::value);
47+
}
48+
4349
#ifdef _WIN32
4450
TEST(StartupTest, WSAStartup) {
4551
WSADATA wsaData;

0 commit comments

Comments
 (0)