Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Commit

Permalink
Fix warning of std::move
Browse files Browse the repository at this point in the history
  • Loading branch information
shuai132 committed Feb 1, 2023
1 parent 54e5dc7 commit 81e28bc
Show file tree
Hide file tree
Showing 28 changed files with 95 additions and 95 deletions.
2 changes: 1 addition & 1 deletion dev/ast/group_by.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace sqlite_orm {

template<class T>
group_by_with_having<T, Args...> having(T expression) {
return {move(this->args), std::move(expression)};
return {std::move(this->args), std::move(expression)};
}
};

Expand Down
4 changes: 2 additions & 2 deletions dev/ast/upsert_clause.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ namespace sqlite_orm {
args_tuple args;

upsert_clause<args_tuple, std::tuple<>> do_nothing() {
return {move(this->args), {}};
return {std::move(this->args), {}};
}

template<class... ActionsArgs>
upsert_clause<args_tuple, std::tuple<ActionsArgs...>> do_update(ActionsArgs... actions) {
return {move(this->args), {std::make_tuple(std::forward<ActionsArgs>(actions)...)}};
return {std::move(this->args), {std::make_tuple(std::forward<ActionsArgs>(actions)...)}};
}
};

Expand Down
4 changes: 2 additions & 2 deletions dev/backup.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ namespace sqlite_orm {
const std::string& zSourceName,
std::unique_ptr<connection_holder> holder_) :
handle(sqlite3_backup_init(to_.get(), zDestName.c_str(), from_.get(), zSourceName.c_str())),
holder(move(holder_)), to(to_), from(from_) {
holder(std::move(holder_)), to(to_), from(from_) {
if(!this->handle) {
throw std::system_error{orm_error_code::failed_to_init_a_backup};
}
}

backup_t(backup_t&& other) :
handle(std::exchange(other.handle, nullptr)), holder(move(other.holder)), to(other.to),
handle(std::exchange(other.handle, nullptr)), holder(std::move(other.holder)), to(other.to),
from(other.from) {}

~backup_t() {
Expand Down
10 changes: 5 additions & 5 deletions dev/column.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ namespace sqlite_orm {
struct column_t : column_identifier, column_field<G, S>, column_constraints<Op...> {
#ifndef SQLITE_ORM_AGGREGATE_BASES_SUPPORTED
column_t(std::string name, G memberPointer, S setter, std::tuple<Op...> op) :
column_identifier{move(name)}, column_field<G, S>{memberPointer, setter}, column_constraints<Op...>{
move(op)} {}
column_identifier{std::move(name)}, column_field<G, S>{memberPointer, setter}, column_constraints<Op...>{
std::move(op)} {}
#endif
};

Expand Down Expand Up @@ -144,7 +144,7 @@ namespace sqlite_orm {
internal::column_t<M, internal::empty_setter, Op...> make_column(std::string name, M m, Op... constraints) {
static_assert(polyfill::conjunction_v<internal::is_constraint<Op>...>, "Incorrect constraints pack");

SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {move(name), m, {}, std::make_tuple(constraints...)});
SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {std::move(name), m, {}, std::make_tuple(constraints...)});
}

/**
Expand All @@ -160,7 +160,7 @@ namespace sqlite_orm {
"Getter and setter must get and set same data type");
static_assert(polyfill::conjunction_v<internal::is_constraint<Op>...>, "Incorrect constraints pack");

SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {move(name), getter, setter, std::make_tuple(constraints...)});
SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {std::move(name), getter, setter, std::make_tuple(constraints...)});
}

/**
Expand All @@ -177,6 +177,6 @@ namespace sqlite_orm {
"Getter and setter must get and set same data type");
static_assert(polyfill::conjunction_v<internal::is_constraint<Op>...>, "Incorrect constraints pack");

SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {move(name), getter, setter, std::make_tuple(constraints...)});
SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(return {std::move(name), getter, setter, std::make_tuple(constraints...)});
}
}
2 changes: 1 addition & 1 deletion dev/column_names_getter.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace sqlite_orm {
newContext.skip_table_name = false;
auto columnName = serialize(t, newContext);
if(!columnName.empty()) {
return {move(columnName)};
return {std::move(columnName)};
} else {
throw std::system_error{orm_error_code::column_not_found};
}
Expand Down
6 changes: 3 additions & 3 deletions dev/conditions.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ namespace sqlite_orm {
order_by_base() = default;

order_by_base(decltype(asc_desc) asc_desc_, decltype(_collate_argument) _collate_argument_) :
asc_desc(asc_desc_), _collate_argument(move(_collate_argument_)) {}
asc_desc(asc_desc_), _collate_argument(std::move(_collate_argument_)) {}
#endif
};

Expand Down Expand Up @@ -508,7 +508,7 @@ namespace sqlite_orm {
std::string name;

dynamic_order_by_entry_t(decltype(name) name_, int asc_desc_, std::string collate_argument_) :
order_by_base{asc_desc_, move(collate_argument_)}, name(move(name_)) {}
order_by_base{asc_desc_, std::move(collate_argument_)}, name(std::move(name_)) {}
};

/**
Expand All @@ -527,7 +527,7 @@ namespace sqlite_orm {
auto newContext = this->context;
newContext.skip_table_name = true;
auto columnName = serialize(order_by.expression, newContext);
this->entries.emplace_back(move(columnName), order_by.asc_desc, move(order_by._collate_argument));
this->entries.emplace_back(std::move(columnName), order_by.asc_desc, std::move(order_by._collate_argument));
}

const_iterator begin() const {
Expand Down
2 changes: 1 addition & 1 deletion dev/connection_holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace sqlite_orm {

struct connection_holder {

connection_holder(std::string filename_) : filename(move(filename_)) {}
connection_holder(std::string filename_) : filename(std::move(filename_)) {}

void retain() {
if(1 == ++this->_retain_count) {
Expand Down
6 changes: 3 additions & 3 deletions dev/constraints.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ namespace sqlite_orm {

columns_tuple columns;

primary_key_t(decltype(columns) columns) : columns(move(columns)) {}
primary_key_t(decltype(columns) columns) : columns(std::move(columns)) {}

self asc() const {
auto res = *this;
Expand Down Expand Up @@ -139,7 +139,7 @@ namespace sqlite_orm {

columns_tuple columns;

unique_t(columns_tuple columns_) : columns(move(columns_)) {}
unique_t(columns_tuple columns_) : columns(std::move(columns_)) {}
};

/**
Expand Down Expand Up @@ -314,7 +314,7 @@ namespace sqlite_orm {
static_assert(!std::is_same<target_type, void>::value, "All references must have the same type");

foreign_key_t(columns_type columns_, references_type references_) :
columns(move(columns_)), references(move(references_)),
columns(std::move(columns_)), references(std::move(references_)),
on_update(*this, true, foreign_key_action::none), on_delete(*this, false, foreign_key_action::none) {}

foreign_key_t(const self& other) :
Expand Down
12 changes: 6 additions & 6 deletions dev/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ namespace sqlite_orm {
decltype(argumentsCount) argumentsCount_,
decltype(create) create_,
decltype(destroy) destroy_) :
name(move(name_)),
argumentsCount(argumentsCount_), create(move(create_)), destroy(destroy_) {}
name(std::move(name_)),
argumentsCount(argumentsCount_), create(std::move(create_)), destroy(destroy_) {}
#endif
};

Expand All @@ -50,8 +50,8 @@ namespace sqlite_orm {
decltype(create) create_,
decltype(run) run_,
decltype(destroy) destroy_) :
user_defined_function_base{move(name_), argumentsCount_, move(create_), destroy_},
run(move(run_)) {}
user_defined_function_base{std::move(name_), argumentsCount_, std::move(create_), destroy_},
run(std::move(run_)) {}
};

struct user_defined_aggregate_function_t : user_defined_function_base {
Expand All @@ -64,8 +64,8 @@ namespace sqlite_orm {
decltype(step) step_,
decltype(finalCall) finalCall_,
decltype(destroy) destroy_) :
user_defined_function_base{move(name_), argumentsCount_, move(create_), destroy_},
step(move(step_)), finalCall(move(finalCall_)) {}
user_defined_function_base{std::move(name_), argumentsCount_, std::move(create_), destroy_},
step(std::move(step_)), finalCall(std::move(finalCall_)) {}
};

template<class F>
Expand Down
2 changes: 1 addition & 1 deletion dev/implementations/table_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace sqlite_orm {
using field_type = field_type_t<std::decay_t<decltype(column)>>;
std::string dft;
if(auto d = column.default_value()) {
dft = move(*d);
dft = std::move(*d);
}
res.emplace_back(-1,
column.name,
Expand Down
8 changes: 4 additions & 4 deletions dev/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace sqlite_orm {
bool unique = false;

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
index_base(std::string name, bool unique) : name{move(name)}, unique{unique} {}
index_base(std::string name, bool unique) : name{std::move(name)}, unique{unique} {}
#endif
};

Expand All @@ -30,7 +30,7 @@ namespace sqlite_orm {

#ifndef SQLITE_ORM_AGGREGATE_BASES_SUPPORTED
index_t(std::string name_, bool unique_, elements_type elements_) :
index_base{move(name_), unique_}, elements(move(elements_)) {}
index_base{std::move(name_), unique_}, elements(std::move(elements_)) {}
#endif

elements_type elements;
Expand All @@ -44,7 +44,7 @@ namespace sqlite_orm {
static_assert(internal::count_tuple<cols_tuple, internal::is_where>::value <= 1,
"amount of where arguments can be 0 or 1");
SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(
return {move(name), false, std::make_tuple(internal::make_indexed_column(std::move(cols))...)});
return {std::move(name), false, std::make_tuple(internal::make_indexed_column(std::move(cols))...)});
}

template<class... Cols>
Expand All @@ -66,6 +66,6 @@ namespace sqlite_orm {
static_assert(internal::count_tuple<cols_tuple, internal::is_where>::value <= 1,
"amount of where arguments can be 0 or 1");
SQLITE_ORM_CLANG_SUPPRESS_MISSING_BRACES(
return {move(name), true, std::make_tuple(internal::make_indexed_column(std::move(cols))...)});
return {std::move(name), true, std::make_tuple(internal::make_indexed_column(std::move(cols))...)});
}
}
2 changes: 1 addition & 1 deletion dev/indexed_column.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace sqlite_orm {

indexed_column_t<column_type> collate(std::string name) {
auto res = std::move(*this);
res._collation_name = move(name);
res._collation_name = std::move(name);
return res;
}

Expand Down
2 changes: 1 addition & 1 deletion dev/iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace sqlite_orm {

iterator_t(){};

iterator_t(statement_finalizer stmt_, view_type& view_) : stmt{move(stmt_)}, view{&view_} {
iterator_t(statement_finalizer stmt_, view_type& view_) : stmt{std::move(stmt_)}, view{&view_} {
next();
}

Expand Down
8 changes: 4 additions & 4 deletions dev/pragma.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ namespace sqlite_orm {
res.reserve(argc);
for(decltype(argc) i = 0; i < argc; ++i) {
auto rowString = row_extractor<std::string>().extract(argv[i]);
res.push_back(move(rowString));
res.push_back(std::move(rowString));
}
return 0;
}

struct pragma_t {
using get_connection_t = std::function<internal::connection_ref()>;

pragma_t(get_connection_t get_connection_) : get_connection(move(get_connection_)) {}
pragma_t(get_connection_t get_connection_) : get_connection(std::move(get_connection_)) {}

void busy_timeout(int value) {
this->set_pragma("busy_timeout", value);
Expand Down Expand Up @@ -139,7 +139,7 @@ namespace sqlite_orm {
++index;
auto pk = std::atoi(argv[index++]);
auto hidden = std::atoi(argv[index++]);
res.emplace_back(cid, move(name), move(type), notnull, move(dflt_value), pk, hidden);
res.emplace_back(cid, std::move(name), std::move(type), notnull, std::move(dflt_value), pk, hidden);
}
return 0;
},
Expand Down Expand Up @@ -169,7 +169,7 @@ namespace sqlite_orm {
std::string dflt_value = argv[index] ? argv[index] : "";
++index;
auto pk = std::atoi(argv[index++]);
res.emplace_back(cid, move(name), move(type), notnull, move(dflt_value), pk);
res.emplace_back(cid, std::move(name), std::move(type), notnull, std::move(dflt_value), pk);
}
return 0;
},
Expand Down
24 changes: 12 additions & 12 deletions dev/prepared_statement.h
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ namespace sqlite_orm {
template<class T, class... Ids>
internal::remove_t<T, Ids...> remove(Ids... ids) {
std::tuple<Ids...> idsTuple{std::forward<Ids>(ids)...};
return {move(idsTuple)};
return {std::move(idsTuple)};
}

/**
Expand All @@ -616,7 +616,7 @@ namespace sqlite_orm {
template<class T, class... Ids>
internal::get_t<T, Ids...> get(Ids... ids) {
std::tuple<Ids...> idsTuple{std::forward<Ids>(ids)...};
return {move(idsTuple)};
return {std::move(idsTuple)};
}

/**
Expand All @@ -627,7 +627,7 @@ namespace sqlite_orm {
template<class T, class... Ids>
internal::get_pointer_t<T, Ids...> get_pointer(Ids... ids) {
std::tuple<Ids...> idsTuple{std::forward<Ids>(ids)...};
return {move(idsTuple)};
return {std::move(idsTuple)};
}

#ifdef SQLITE_ORM_OPTIONAL_SUPPORTED
Expand All @@ -639,7 +639,7 @@ namespace sqlite_orm {
template<class T, class... Ids>
internal::get_optional_t<T, Ids...> get_optional(Ids... ids) {
std::tuple<Ids...> idsTuple{std::forward<Ids>(ids)...};
return {move(idsTuple)};
return {std::move(idsTuple)};
}
#endif // SQLITE_ORM_OPTIONAL_SUPPORTED

Expand All @@ -653,7 +653,7 @@ namespace sqlite_orm {
using args_tuple = std::tuple<Args...>;
internal::validate_conditions<args_tuple>();
args_tuple conditions{std::forward<Args>(args)...};
return {move(conditions)};
return {std::move(conditions)};
}

/**
Expand All @@ -666,7 +666,7 @@ namespace sqlite_orm {
using args_tuple = std::tuple<Args...>;
internal::validate_conditions<args_tuple>();
args_tuple conditions{std::forward<Args>(args)...};
return {move(conditions)};
return {std::move(conditions)};
}

/**
Expand All @@ -680,7 +680,7 @@ namespace sqlite_orm {
using args_tuple = std::tuple<Args...>;
internal::validate_conditions<args_tuple>();
args_tuple conditions{std::forward<Args>(args)...};
return {move(conditions)};
return {std::move(conditions)};
}

/**
Expand All @@ -693,7 +693,7 @@ namespace sqlite_orm {
using args_tuple = std::tuple<Wargs...>;
internal::validate_conditions<args_tuple>();
args_tuple conditions{std::forward<Wargs>(wh)...};
return {std::move(set), move(conditions)};
return {std::move(set), std::move(conditions)};
}

/**
Expand All @@ -706,7 +706,7 @@ namespace sqlite_orm {
using args_tuple = std::tuple<Args...>;
internal::validate_conditions<args_tuple>();
args_tuple conditions{std::forward<Args>(args)...};
return {move(conditions)};
return {std::move(conditions)};
}
/**
* Create a get all pointer statement.
Expand All @@ -719,7 +719,7 @@ namespace sqlite_orm {
using args_tuple = std::tuple<Args...>;
internal::validate_conditions<args_tuple>();
args_tuple conditions{std::forward<Args>(args)...};
return {move(conditions)};
return {std::move(conditions)};
}

#ifdef SQLITE_ORM_OPTIONAL_SUPPORTED
Expand All @@ -733,7 +733,7 @@ namespace sqlite_orm {
using args_tuple = std::tuple<Args...>;
internal::validate_conditions<args_tuple>();
args_tuple conditions{std::forward<Args>(args)...};
return {move(conditions)};
return {std::move(conditions)};
}

/**
Expand All @@ -747,7 +747,7 @@ namespace sqlite_orm {
using args_tuple = std::tuple<Args...>;
internal::validate_conditions<args_tuple>();
args_tuple conditions{std::forward<Args>(args)...};
return {move(conditions)};
return {std::move(conditions)};
}
#endif // SQLITE_ORM_OPTIONAL_SUPPORTED
}
Loading

0 comments on commit 81e28bc

Please sign in to comment.