MDEV-35837 Move to c++17

Move from c++11 to c++17.
This commit is contained in:
Dave Gosselin 2025-01-13 14:48:43 -05:00
parent 3761a7fec8
commit 941daa6b52
9 changed files with 11 additions and 21 deletions

View file

@ -85,7 +85,7 @@ IF(CMAKE_VERSION VERSION_LESS "3.1")
ENDIF()
ELSE()
SET(CMAKE_C_STANDARD 99)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD 17)
ENDIF()
# Lower case package names from PROJECT are used if not explictly upper case.

View file

@ -175,7 +175,7 @@ struct dbcontext : public dbcontext_i, private noncopyable {
THD *thd;
MYSQL_LOCK *lock;
bool lock_failed;
std::auto_ptr<expr_user_lock> user_lock;
std::unique_ptr<expr_user_lock> user_lock;
int user_level_lock_timeout;
bool user_level_lock_locked;
bool commit_error;

View file

@ -9,11 +9,6 @@
#ifndef DENA_DATABASE_HPP
#define DENA_DATABASE_HPP
#ifdef __GNUC__
/* auto_ptr is deprecated */
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#include <string>
#include <memory>
#include <vector>
@ -26,10 +21,10 @@
namespace dena {
struct database_i;
typedef std::auto_ptr<volatile database_i> database_ptr;
typedef std::unique_ptr<volatile database_i> database_ptr;
struct dbcontext_i;
typedef std::auto_ptr<dbcontext_i> dbcontext_ptr;
typedef std::unique_ptr<dbcontext_i> dbcontext_ptr;
struct database_i {
virtual ~database_i() = default;

View file

@ -76,7 +76,7 @@ daemon_handlersocket_init(void *p)
conf["readsize"] = to_stdstring(handlersocket_readsize);
conf["accept_balance"] = to_stdstring(handlersocket_accept_balance);
conf["wrlock_timeout"] = to_stdstring(handlersocket_wrlock_timeout);
std::auto_ptr<daemon_handlersocket_data> ap(new daemon_handlersocket_data);
std::unique_ptr<daemon_handlersocket_data> ap(new daemon_handlersocket_data);
if (handlersocket_port != 0 && handlersocket_port_wr != handlersocket_port) {
conf["port"] = handlersocket_port;
if (handlersocket_plain_secret) {

View file

@ -115,7 +115,7 @@ hstcpsvr::start_listen()
arg.cshared = &cshared;
arg.vshared = &vshared;
arg.worker_id = i;
std::auto_ptr< thread<worker_throbj> > thr(
std::unique_ptr< thread<worker_throbj> > thr(
new thread<worker_throbj>(arg, stack_size));
threads.push_back_ptr(thr);
}

View file

@ -44,7 +44,7 @@ struct hstcpsvr_shared_v : public mutex {
};
struct hstcpsvr_i;
typedef std::auto_ptr<hstcpsvr_i> hstcpsvr_ptr;
typedef std::unique_ptr<hstcpsvr_i> hstcpsvr_ptr;
struct hstcpsvr_i {
virtual ~hstcpsvr_i() = default;

View file

@ -451,7 +451,7 @@ hstcpsvr_worker::run_one_nb()
{
pollfd& pfd = pfds[nfds - 1];
if ((pfd.revents & mask_in) != 0) {
std::auto_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
std::unique_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
c->nonblocking = true;
c->readsize = cshared.readsize;
c->accept(cshared);
@ -498,7 +498,7 @@ hstcpsvr_worker::run_one_ep()
/* listener */
++accept_count;
DBG_EP(fprintf(stderr, "IN listener\n"));
std::auto_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
std::unique_ptr<hstcpsvr_conn> c(new hstcpsvr_conn());
c->nonblocking = true;
c->readsize = cshared.readsize;
c->accept(cshared);

View file

@ -14,7 +14,7 @@
namespace dena {
struct hstcpsvr_worker_i;
typedef std::auto_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr;
typedef std::unique_ptr<hstcpsvr_worker_i> hstcpsvr_worker_ptr;
struct hstcpsvr_worker_arg {
const hstcpsvr_shared_c *cshared;

View file

@ -19,11 +19,6 @@
#include "string_ref.hpp"
#include "string_buffer.hpp"
#ifdef __GNUC__
/* auto_ptr is deprecated */
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
namespace dena {
struct hstcpcli_filter {
@ -35,7 +30,7 @@ struct hstcpcli_filter {
};
struct hstcpcli_i;
typedef std::auto_ptr<hstcpcli_i> hstcpcli_ptr;
typedef std::unique_ptr<hstcpcli_i> hstcpcli_ptr;
struct hstcpcli_i {
virtual ~hstcpcli_i() = default;