clickhouse-cpp
clickhouse-cpp copied to clipboard
clickhouse client move support
As user of the library, the absence of support for move restricts design choices as it forces to use (smart or raw) ptr on Client or to make user classes non-movable too to accommodate. While this is not dramatic, it is not ideal either. Looking at Client implementation, it has two members:
- a unique_ptr to Impl which by definition should have correct and well defined move
- a const ClientInfo object, as far as I saw all members are movable with non surprising side effect (std::string, std::vector, raw ptr and native integer types), by removing the const qualifier we make sure it is moved rather than copied (which could have unintended consequence for the raw ptr especially).
Hence I do not see large obstacle to make Client movable but happy to have second opinions from regular contributors. This is to kick start some discussions on the topic, I can test the change further on some applications if there is no opposition to the idea.