From 0d6c63ce209b88ecccda454108db0e60b875bf5c Mon Sep 17 00:00:00 2001 From: rbock Date: Sun, 10 Sep 2017 15:40:54 +0200 Subject: [PATCH] Use clang-tidy modernize fixes --- include/sqlpp11/data_types/text/operand.h | 3 ++- include/sqlpp11/insert.h | 2 +- include/sqlpp11/parameter.h | 4 +--- include/sqlpp11/parameter_list.h | 4 +--- include/sqlpp11/remove.h | 2 +- include/sqlpp11/result_row.h | 15 ++++++++------- include/sqlpp11/schema_qualified_table.h | 4 +++- include/sqlpp11/statement.h | 4 +--- include/sqlpp11/verbatim.h | 4 +++- include/sqlpp11/verbatim_table.h | 4 +++- 10 files changed, 24 insertions(+), 22 deletions(-) diff --git a/include/sqlpp11/data_types/text/operand.h b/include/sqlpp11/data_types/text/operand.h index 32014139..ba8c9cfa 100644 --- a/include/sqlpp11/data_types/text/operand.h +++ b/include/sqlpp11/data_types/text/operand.h @@ -28,6 +28,7 @@ #define SQLPP11_DATA_TYPES_TEXT_OPERAND_H #include +#include #include #include #include @@ -48,7 +49,7 @@ namespace sqlpp { } - text_operand(_value_t t) : _t(t) + text_operand(_value_t t) : _t(std::move(t)) { } diff --git a/include/sqlpp11/insert.h b/include/sqlpp11/insert.h index 0d7d93a3..e1672cff 100644 --- a/include/sqlpp11/insert.h +++ b/include/sqlpp11/insert.h @@ -107,7 +107,7 @@ namespace sqlpp inline auto insert() -> blank_insert_t { - return {blank_insert_t()}; + return {}; } template diff --git a/include/sqlpp11/parameter.h b/include/sqlpp11/parameter.h index 41855b7b..f7034a49 100644 --- a/include/sqlpp11/parameter.h +++ b/include/sqlpp11/parameter.h @@ -46,9 +46,7 @@ namespace sqlpp using _instance_t = member_t>; - parameter_t() - { - } + parameter_t() = default; parameter_t(const parameter_t&) = default; parameter_t(parameter_t&&) = default; diff --git a/include/sqlpp11/parameter_list.h b/include/sqlpp11/parameter_list.h index 82dfe19f..e19ee5e5 100644 --- a/include/sqlpp11/parameter_list.h +++ b/include/sqlpp11/parameter_list.h @@ -46,9 +46,7 @@ namespace sqlpp using _member_tuple_t = std::tuple; using size = std::integral_constant; - parameter_list_t() - { - } + parameter_list_t() = default; template void _bind(Target& target) const diff --git a/include/sqlpp11/remove.h b/include/sqlpp11/remove.h index 58e46fda..44bd1c52 100644 --- a/include/sqlpp11/remove.h +++ b/include/sqlpp11/remove.h @@ -106,7 +106,7 @@ namespace sqlpp inline auto remove() -> blank_remove_t { - return {blank_remove_t()}; + return {}; } template diff --git a/include/sqlpp11/result_row.h b/include/sqlpp11/result_row.h index c214e8d4..65f5d103 100644 --- a/include/sqlpp11/result_row.h +++ b/include/sqlpp11/result_row.h @@ -28,6 +28,7 @@ #define SQLPP11_RESULT_ROW_H #include +#include #include #include #include @@ -184,13 +185,13 @@ namespace sqlpp { using _field_index_sequence = detail::make_field_index_sequence<0, FieldSpecs...>; using _impl = detail::result_row_impl; - bool _is_valid; + bool _is_valid{false}; - result_row_t() : _impl(), _is_valid(false) + result_row_t() : _impl() { } - result_row_t(const typename dynamic_select_column_list::_names_t& /*unused*/) : _impl(), _is_valid(false) + result_row_t(const typename dynamic_select_column_list::_names_t& /*unused*/) : _impl() { } @@ -273,16 +274,16 @@ namespace sqlpp using _impl = detail::result_row_impl; using _field_type = result_field_t>; - bool _is_valid; + bool _is_valid{false}; std::vector _dynamic_field_names; std::map _dynamic_fields; - dynamic_result_row_t() : _impl(), _is_valid(false) + dynamic_result_row_t() : _impl() { } - dynamic_result_row_t(const std::vector& dynamic_field_names) - : _impl(), _is_valid(false), _dynamic_field_names(dynamic_field_names) + dynamic_result_row_t(std::vector dynamic_field_names) + : _impl(), _dynamic_field_names(std::move(dynamic_field_names)) { for (auto field_name : _dynamic_field_names) { diff --git a/include/sqlpp11/schema_qualified_table.h b/include/sqlpp11/schema_qualified_table.h index 286a5e27..69f98036 100644 --- a/include/sqlpp11/schema_qualified_table.h +++ b/include/sqlpp11/schema_qualified_table.h @@ -34,6 +34,8 @@ #include #include +#include + namespace sqlpp { template @@ -45,7 +47,7 @@ namespace sqlpp using _required_ctes = detail::type_set<>; using _provided_tables = detail::type_set<>; - schema_qualified_table_t(schema_t schema, Table table) : _schema(schema), _table(table) + schema_qualified_table_t(schema_t schema, Table table) : _schema(std::move(schema)), _table(table) { } diff --git a/include/sqlpp11/statement.h b/include/sqlpp11/statement.h index e53c24ae..8cc4396b 100644 --- a/include/sqlpp11/statement.h +++ b/include/sqlpp11/statement.h @@ -197,9 +197,7 @@ namespace sqlpp using _alias_t = typename _result_type_provider::_alias_t; // Constructors - statement_t() - { - } + statement_t() = default; // workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269 // template diff --git a/include/sqlpp11/verbatim.h b/include/sqlpp11/verbatim.h index 1f0c6d3d..e4d367fa 100644 --- a/include/sqlpp11/verbatim.h +++ b/include/sqlpp11/verbatim.h @@ -31,6 +31,8 @@ #include #include +#include + namespace sqlpp { template // Csaba Csoma suggests: unsafe_sql instead of verbatim @@ -42,7 +44,7 @@ namespace sqlpp using _can_be_null = std::true_type; // since we do not know what's going on inside the verbatim, we assume it can be null - verbatim_t(std::string verbatim) : _verbatim(verbatim) + verbatim_t(std::string verbatim) : _verbatim(std::move(verbatim)) { } verbatim_t(const verbatim_t&) = default; diff --git a/include/sqlpp11/verbatim_table.h b/include/sqlpp11/verbatim_table.h index 0b0b0c26..86ddf2dd 100644 --- a/include/sqlpp11/verbatim_table.h +++ b/include/sqlpp11/verbatim_table.h @@ -31,6 +31,8 @@ #include #include +#include + namespace sqlpp { namespace detail @@ -60,7 +62,7 @@ namespace sqlpp using _name_t = sqlpp::make_char_sequence; }; - verbatim_table_t(std::string representation) : _representation(representation) + verbatim_table_t(std::string representation) : _representation(std::move(representation)) { }