mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-15 20:31:16 +08:00
Use clang-tidy modernize fixes
This commit is contained in:
parent
a17a78c5c2
commit
0d6c63ce20
@ -28,6 +28,7 @@
|
|||||||
#define SQLPP11_DATA_TYPES_TEXT_OPERAND_H
|
#define SQLPP11_DATA_TYPES_TEXT_OPERAND_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
#include <sqlpp11/type_traits.h>
|
#include <sqlpp11/type_traits.h>
|
||||||
#include <sqlpp11/alias_operators.h>
|
#include <sqlpp11/alias_operators.h>
|
||||||
#include <sqlpp11/serializer.h>
|
#include <sqlpp11/serializer.h>
|
||||||
@ -48,7 +49,7 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
text_operand(_value_t t) : _t(t)
|
text_operand(_value_t t) : _t(std::move(t))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
inline auto insert() -> blank_insert_t<void>
|
inline auto insert() -> blank_insert_t<void>
|
||||||
{
|
{
|
||||||
return {blank_insert_t<void>()};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Table>
|
template <typename Table>
|
||||||
|
@ -46,9 +46,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
using _instance_t = member_t<NameType, parameter_value_t<ValueType>>;
|
using _instance_t = member_t<NameType, parameter_value_t<ValueType>>;
|
||||||
|
|
||||||
parameter_t()
|
parameter_t() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
parameter_t(const parameter_t&) = default;
|
parameter_t(const parameter_t&) = default;
|
||||||
parameter_t(parameter_t&&) = default;
|
parameter_t(parameter_t&&) = default;
|
||||||
|
@ -46,9 +46,7 @@ namespace sqlpp
|
|||||||
using _member_tuple_t = std::tuple<typename Parameter::_instance_t...>;
|
using _member_tuple_t = std::tuple<typename Parameter::_instance_t...>;
|
||||||
using size = std::integral_constant<std::size_t, sizeof...(Parameter)>;
|
using size = std::integral_constant<std::size_t, sizeof...(Parameter)>;
|
||||||
|
|
||||||
parameter_list_t()
|
parameter_list_t() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Target>
|
template <typename Target>
|
||||||
void _bind(Target& target) const
|
void _bind(Target& target) const
|
||||||
|
@ -106,7 +106,7 @@ namespace sqlpp
|
|||||||
|
|
||||||
inline auto remove() -> blank_remove_t<void>
|
inline auto remove() -> blank_remove_t<void>
|
||||||
{
|
{
|
||||||
return {blank_remove_t<void>()};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Table>
|
template <typename Table>
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
#define SQLPP11_RESULT_ROW_H
|
#define SQLPP11_RESULT_ROW_H
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <utility>
|
||||||
#include <sqlpp11/data_types/text.h>
|
#include <sqlpp11/data_types/text.h>
|
||||||
#include <sqlpp11/detail/field_index_sequence.h>
|
#include <sqlpp11/detail/field_index_sequence.h>
|
||||||
#include <sqlpp11/dynamic_select_column_list.h>
|
#include <sqlpp11/dynamic_select_column_list.h>
|
||||||
@ -184,13 +185,13 @@ namespace sqlpp
|
|||||||
{
|
{
|
||||||
using _field_index_sequence = detail::make_field_index_sequence<0, FieldSpecs...>;
|
using _field_index_sequence = detail::make_field_index_sequence<0, FieldSpecs...>;
|
||||||
using _impl = detail::result_row_impl<Db, _field_index_sequence, FieldSpecs...>;
|
using _impl = detail::result_row_impl<Db, _field_index_sequence, FieldSpecs...>;
|
||||||
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<void>::_names_t& /*unused*/) : _impl(), _is_valid(false)
|
result_row_t(const typename dynamic_select_column_list<void>::_names_t& /*unused*/) : _impl()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,16 +274,16 @@ namespace sqlpp
|
|||||||
using _impl = detail::result_row_impl<Db, _field_index_sequence, FieldSpecs...>;
|
using _impl = detail::result_row_impl<Db, _field_index_sequence, FieldSpecs...>;
|
||||||
using _field_type = result_field_t<Db, field_spec_t<no_name_t, text, true, true>>;
|
using _field_type = result_field_t<Db, field_spec_t<no_name_t, text, true, true>>;
|
||||||
|
|
||||||
bool _is_valid;
|
bool _is_valid{false};
|
||||||
std::vector<std::string> _dynamic_field_names;
|
std::vector<std::string> _dynamic_field_names;
|
||||||
std::map<std::string, _field_type> _dynamic_fields;
|
std::map<std::string, _field_type> _dynamic_fields;
|
||||||
|
|
||||||
dynamic_result_row_t() : _impl(), _is_valid(false)
|
dynamic_result_row_t() : _impl()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
dynamic_result_row_t(const std::vector<std::string>& dynamic_field_names)
|
dynamic_result_row_t(std::vector<std::string> dynamic_field_names)
|
||||||
: _impl(), _is_valid(false), _dynamic_field_names(dynamic_field_names)
|
: _impl(), _dynamic_field_names(std::move(dynamic_field_names))
|
||||||
{
|
{
|
||||||
for (auto field_name : _dynamic_field_names)
|
for (auto field_name : _dynamic_field_names)
|
||||||
{
|
{
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
#include <sqlpp11/table_alias.h>
|
#include <sqlpp11/table_alias.h>
|
||||||
#include <sqlpp11/detail/type_set.h>
|
#include <sqlpp11/detail/type_set.h>
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
namespace sqlpp
|
namespace sqlpp
|
||||||
{
|
{
|
||||||
template <typename Table>
|
template <typename Table>
|
||||||
@ -45,7 +47,7 @@ namespace sqlpp
|
|||||||
using _required_ctes = detail::type_set<>;
|
using _required_ctes = detail::type_set<>;
|
||||||
using _provided_tables = 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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -197,9 +197,7 @@ namespace sqlpp
|
|||||||
using _alias_t = typename _result_type_provider::_alias_t;
|
using _alias_t = typename _result_type_provider::_alias_t;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
statement_t()
|
statement_t() = default;
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
|
// workaround for msvc bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2173269
|
||||||
// template <typename Statement, typename Term>
|
// template <typename Statement, typename Term>
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include <sqlpp11/type_traits.h>
|
#include <sqlpp11/type_traits.h>
|
||||||
#include <sqlpp11/serialize.h>
|
#include <sqlpp11/serialize.h>
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
namespace sqlpp
|
namespace sqlpp
|
||||||
{
|
{
|
||||||
template <typename ValueType> // Csaba Csoma suggests: unsafe_sql instead of verbatim
|
template <typename ValueType> // Csaba Csoma suggests: unsafe_sql instead of verbatim
|
||||||
@ -42,7 +44,7 @@ namespace sqlpp
|
|||||||
using _can_be_null =
|
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
|
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;
|
verbatim_t(const verbatim_t&) = default;
|
||||||
|
@ -31,6 +31,8 @@
|
|||||||
#include <sqlpp11/char_sequence.h>
|
#include <sqlpp11/char_sequence.h>
|
||||||
#include <sqlpp11/data_types/no_value.h>
|
#include <sqlpp11/data_types/no_value.h>
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
namespace sqlpp
|
namespace sqlpp
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
@ -60,7 +62,7 @@ namespace sqlpp
|
|||||||
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
using _name_t = sqlpp::make_char_sequence<sizeof(_literal), _literal>;
|
||||||
};
|
};
|
||||||
|
|
||||||
verbatim_table_t(std::string representation) : _representation(representation)
|
verbatim_table_t(std::string representation) : _representation(std::move(representation))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user