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

Commit

Permalink
Qualified remaining calls to std::move()
Browse files Browse the repository at this point in the history
  • Loading branch information
trueqbit committed Feb 2, 2023
1 parent 1a3f466 commit 46469ac
Show file tree
Hide file tree
Showing 41 changed files with 94 additions and 89 deletions.
8 changes: 4 additions & 4 deletions dev/ast/set.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ namespace sqlite_orm {
}

dynamic_set_t(dynamic_set_t&& other) :
entries(move(other.entries)), context(std::move(other.context)),
entries(std::move(other.entries)), context(std::move(other.context)),
collector([this](const std::type_index& ti) {
return find_table_name(this->context.db_objects, ti);
}) {
collector.table_names = move(other.collector.table_names);
collector.table_names = std::move(other.collector.table_names);
}

dynamic_set_t& operator=(const dynamic_set_t& other) {
Expand All @@ -68,12 +68,12 @@ namespace sqlite_orm {
}

dynamic_set_t& operator=(dynamic_set_t&& other) {
this->entries = move(other.entries);
this->entries = std::move(other.entries);
this->context = std::move(other.context);
this->collector = table_name_collector([this](const std::type_index& ti) {
return find_table_name(this->context.db_objects, ti);
});
this->collector.table_names = move(other.collector.table_names);
this->collector.table_names = std::move(other.collector.table_names);
}

template<class L, class R>
Expand Down
2 changes: 1 addition & 1 deletion dev/index.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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 Down
2 changes: 1 addition & 1 deletion dev/statement_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ namespace sqlite_orm {
struct table_name_collector_holder<set_t<Args...>> {

table_name_collector_holder(table_name_collector::find_table_name_t find_table_name) :
collector(move(find_table_name)) {}
collector(std::move(find_table_name)) {}

table_name_collector collector;
};
Expand Down
2 changes: 1 addition & 1 deletion examples/case.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main() {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Student() {}
Student(int id, std::string name, std::string email, float marks) :
id{id}, name{move(name)}, email{move(email)}, marks{marks} {}
id{id}, name{std::move(name)}, email{std::move(email)}, marks{marks} {}
#endif
};

Expand Down
5 changes: 3 additions & 2 deletions examples/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ int main() {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Contact() {}
Contact(int id, std::string firstName, std::string lastName, std::string email, std::string phone) :
id{id}, firstName{move(firstName)}, lastName{move(lastName)}, email{move(email)}, phone{move(phone)} {}
id{id}, firstName{std::move(firstName)}, lastName{std::move(lastName)}, email{std::move(email)},
phone{std::move(phone)} {}
#endif
};

Expand All @@ -30,7 +31,7 @@ int main() {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Product() {}
Product(int id, std::string name, float listPrice, float discount) :
id{id}, name{move(name)}, listPrice{listPrice}, discount{discount} {}
id{id}, name{std::move(name)}, listPrice{listPrice}, discount{discount} {}
#endif
};

Expand Down
2 changes: 1 addition & 1 deletion examples/column_aliases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void marvel_hero_ordered_by_o_pos() {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
MarvelHero() {}
MarvelHero(int id, std::string name, std::string abilities, short points) :
id{id}, name{move(name)}, abilities{move(abilities)}, points{points} {}
id{id}, name{std::move(name)}, abilities{std::move(abilities)}, points{points} {}
#endif
};

Expand Down
11 changes: 6 additions & 5 deletions examples/core_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct MarvelHero {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
MarvelHero() {}
MarvelHero(int id, std::string name, std::string abilities, short points) :
id{id}, name{move(name)}, abilities{move(abilities)}, points{points} {}
id{id}, name{std::move(name)}, abilities{std::move(abilities)}, points{points} {}
#endif
};

Expand All @@ -27,7 +27,7 @@ struct Contact {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Contact() {}
Contact(int id, std::string firstName, std::string lastName, std::string phone) :
id{id}, firstName{move(firstName)}, lastName{move(lastName)}, phone{move(phone)} {}
id{id}, firstName{std::move(firstName)}, lastName{std::move(lastName)}, phone{std::move(phone)} {}
#endif
};

Expand Down Expand Up @@ -62,9 +62,10 @@ struct Customer {
std::string email,
int supportRepId) :
id{id},
firstName{move(firstName)}, lastName{move(lastName)}, company{move(company)}, address{move(address)},
city{move(city)}, state{move(state)}, country{move(country)}, postalCode{move(postalCode)}, phone{move(phone)},
fax{move(fax)}, email{move(email)}, supportRepId{supportRepId} {}
firstName{std::move(firstName)}, lastName{std::move(lastName)}, company{std::move(company)},
address{std::move(address)}, city{std::move(city)}, state{std::move(state)}, country{std::move(country)},
postalCode{std::move(postalCode)}, phone{std::move(phone)}, fax{std::move(fax)}, email{std::move(email)},
supportRepId{supportRepId} {}
#endif
};

Expand Down
4 changes: 2 additions & 2 deletions examples/custom_aliases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct Employee {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Employee() {}
Employee(int id, std::string name, int age, std::string address, float salary) :
id{id}, name{move(name)}, age{age}, address{move(address)}, salary{salary} {}
id{id}, name{std::move(name)}, age{age}, address{std::move(address)}, salary{salary} {}
#endif
};

Expand All @@ -32,7 +32,7 @@ struct Department {

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Department() {}
Department(int id, std::string dept, int empId) : id{id}, dept{move(dept)}, empId{empId} {}
Department(int id, std::string dept, int empId) : id{id}, dept{std::move(dept)}, empId{empId} {}
#endif
};

Expand Down
4 changes: 2 additions & 2 deletions examples/except_intersection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct DeptMaster {

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
DeptMaster() = default;
DeptMaster(int deptId, std::string deptName) : deptId{deptId}, deptName{move(deptName)} {}
DeptMaster(int deptId, std::string deptName) : deptId{deptId}, deptName{std::move(deptName)} {}
#endif
};

Expand All @@ -33,7 +33,7 @@ struct EmpMaster {
long salary,
decltype(DeptMaster::deptId) deptId) :
empId{empId},
firstName{move(firstName)}, lastName{move(lastName)}, salary{salary}, deptId{deptId} {}
firstName{std::move(firstName)}, lastName{std::move(lastName)}, salary{salary}, deptId{deptId} {}
#endif
};

Expand Down
2 changes: 1 addition & 1 deletion examples/generated_column.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int main() {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Product() {}
Product(int id, std::string name, int quantity, float price, float totalValue = 0.f) :
id{id}, name{move(name)}, quantity{quantity}, price{price}, totalValue{totalValue} {}
id{id}, name{std::move(name)}, quantity{quantity}, price{price}, totalValue{totalValue} {}
#endif
};
auto storage = make_storage({},
Expand Down
6 changes: 3 additions & 3 deletions examples/prepared_statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct Doctor {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Doctor() = default;
Doctor(int doctor_id, std::string doctor_name, std::string degree) :
doctor_id{doctor_id}, doctor_name{move(doctor_name)}, degree{move(degree)} {}
doctor_id{doctor_id}, doctor_name{std::move(doctor_name)}, degree{std::move(degree)} {}
#endif
};

Expand All @@ -34,7 +34,7 @@ struct Speciality {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Speciality() = default;
Speciality(int spl_id, std::string spl_descrip, int doctor_id) :
spl_id{spl_id}, spl_descrip{move(spl_descrip)}, doctor_id{doctor_id} {}
spl_id{spl_id}, spl_descrip{std::move(spl_descrip)}, doctor_id{doctor_id} {}
#endif
};

Expand All @@ -46,7 +46,7 @@ struct Visit {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Visit() = default;
Visit(int doctor_id, std::string patient_name, std::string vdate) :
doctor_id{doctor_id}, patient_name{move(patient_name)}, vdate{move(vdate)} {}
doctor_id{doctor_id}, patient_name{std::move(patient_name)}, vdate{std::move(vdate)} {}
#endif
};

Expand Down
3 changes: 2 additions & 1 deletion examples/triggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ struct Lead {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Lead() = default;
Lead(int id, std::string firstName, std::string lastName, std::string email, std::string phone) :
id{id}, firstName{move(firstName)}, lastName{move(lastName)}, email{move(email)}, phone{move(phone)} {}
id{id}, firstName{std::move(firstName)}, lastName{std::move(lastName)}, email{std::move(email)},
phone{std::move(phone)} {}
#endif
};

Expand Down
14 changes: 7 additions & 7 deletions include/sqlite_orm/sqlite_orm.h
Original file line number Diff line number Diff line change
Expand Up @@ -9078,7 +9078,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 Down Expand Up @@ -11239,11 +11239,11 @@ namespace sqlite_orm {
}

dynamic_set_t(dynamic_set_t&& other) :
entries(move(other.entries)), context(std::move(other.context)),
entries(std::move(other.entries)), context(std::move(other.context)),
collector([this](const std::type_index& ti) {
return find_table_name(this->context.db_objects, ti);
}) {
collector.table_names = move(other.collector.table_names);
collector.table_names = std::move(other.collector.table_names);
}

dynamic_set_t& operator=(const dynamic_set_t& other) {
Expand All @@ -11256,12 +11256,12 @@ namespace sqlite_orm {
}

dynamic_set_t& operator=(dynamic_set_t&& other) {
this->entries = move(other.entries);
this->entries = std::move(other.entries);
this->context = std::move(other.context);
this->collector = table_name_collector([this](const std::type_index& ti) {
return find_table_name(this->context.db_objects, ti);
});
this->collector.table_names = move(other.collector.table_names);
this->collector.table_names = std::move(other.collector.table_names);
}

template<class L, class R>
Expand Down Expand Up @@ -16295,7 +16295,7 @@ namespace sqlite_orm {
struct table_name_collector_holder<set_t<Args...>> {

table_name_collector_holder(table_name_collector::find_table_name_t find_table_name) :
collector(move(find_table_name)) {}
collector(std::move(find_table_name)) {}

table_name_collector collector;
};
Expand Down Expand Up @@ -19229,7 +19229,7 @@ namespace sqlite_orm {

/**
* Generalized form of the 'remember' SQL function that is a pass-through for values
* (it returns its argument unchanged using move semantics) but also saves the
* (it returns its argument unchanged using std::move semantics) but also saves the
* value that is passed through into a bound variable.
*/
template<typename P>
Expand Down
2 changes: 1 addition & 1 deletion tests/backup_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace {

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
User() = default;
User(int id, std::string name) : id{id}, name{move(name)} {}
User(int id, std::string name) : id{id}, name{std::move(name)} {}
#endif
};

Expand Down
15 changes: 8 additions & 7 deletions tests/built_in_functions_tests/core_functions_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ TEST_CASE("substr") {

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Test() = default;
Test(std::string text, int x, int y) : text{move(text)}, x{x}, y{y} {}
Test(std::string text, int x, int y) : text{std::move(text)}, x{x}, y{y} {}
#endif
};
auto storage = make_storage(
Expand Down Expand Up @@ -184,7 +184,7 @@ TEST_CASE("quote") {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Department() = default;
Department(int id, std::string name, int managerId, int locationId) :
id{id}, name{move(name)}, managerId{managerId}, locationId{locationId} {}
id{id}, name{std::move(name)}, managerId{managerId}, locationId{locationId} {}
#endif
};
auto storage = make_storage({},
Expand Down Expand Up @@ -268,7 +268,7 @@ TEST_CASE("instr") {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Employee() = default;
Employee(int id, std::string firstName, std::string lastName, std::string address) :
id{id}, firstName{move(firstName)}, lastName{move(lastName)}, address{move(address)} {}
id{id}, firstName{std::move(firstName)}, lastName{std::move(lastName)}, address{std::move(address)} {}
#endif
};

Expand Down Expand Up @@ -340,7 +340,7 @@ namespace replace_func_local {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Contact() = default;
Contact(int id, std::string firstName, std::string lastName, std::string phone) :
id{id}, firstName{move(firstName)}, lastName{move(lastName)}, phone{move(phone)} {}
id{id}, firstName{std::move(firstName)}, lastName{std::move(lastName)}, phone{std::move(phone)} {}
#endif
};

Expand Down Expand Up @@ -541,9 +541,10 @@ TEST_CASE("ifnull") {
std::string email,
int supportRepId) :
id{id},
firstName{move(firstName)}, lastName{move(lastName)}, company{move(company)}, address{move(address)},
city{move(city)}, state{move(state)}, country{move(country)}, postalCode{move(postalCode)},
phone{move(phone)}, fax{move(fax)}, email{move(email)}, supportRepId{supportRepId} {}
firstName{std::move(firstName)}, lastName{std::move(lastName)}, company{std::move(company)},
address{std::move(address)}, city{std::move(city)}, state{std::move(state)}, country{std::move(country)},
postalCode{std::move(postalCode)}, phone{std::move(phone)}, fax{std::move(fax)}, email{std::move(email)},
supportRepId{supportRepId} {}
#endif
};
auto storage = make_storage({},
Expand Down
6 changes: 3 additions & 3 deletions tests/constraints/unique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TEST_CASE("Unique") {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Contact() = default;
Contact(int id, std::string firstName, std::string lastName, std::string email) :
id{id}, firstName{move(firstName)}, lastName{move(lastName)}, email{move(email)} {}
id{id}, firstName{std::move(firstName)}, lastName{std::move(lastName)}, email{std::move(email)} {}
#endif
};
struct Shape {
Expand All @@ -26,7 +26,7 @@ TEST_CASE("Unique") {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Shape() = default;
Shape(int id, std::string backgroundColor, std::string foregroundColor) :
id{id}, backgroundColor{move(backgroundColor)}, foregroundColor{move(foregroundColor)} {}
id{id}, backgroundColor{std::move(backgroundColor)}, foregroundColor{std::move(foregroundColor)} {}
#endif
};
struct List {
Expand All @@ -35,7 +35,7 @@ TEST_CASE("Unique") {

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
List() = default;
List(int id, decltype(email) email) : id{id}, email{move(email)} {}
List(int id, decltype(email) email) : id{id}, email{std::move(email)} {}
#endif
};

Expand Down
2 changes: 1 addition & 1 deletion tests/get_all_custom_containers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace {

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
User() = default;
User(int id, std::string name) : id{id}, name{move(name)} {}
User(int id, std::string name) : id{id}, name{std::move(name)} {}
#endif
};

Expand Down
2 changes: 1 addition & 1 deletion tests/index_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ TEST_CASE("Compound index") {

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
User() = default;
User(int id, std::string name) : id{id}, name{move(name)} {}
User(int id, std::string name) : id{id}, name{std::move(name)} {}
#endif
};
auto table = make_table("users", make_column("id", &User::id), make_column("name", &User::name));
Expand Down
2 changes: 1 addition & 1 deletion tests/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ TEST_CASE("json_array_length nullable") {
rows = storage.select(json_array_length<Type>("{\"one\":[1,2,3]}", "$.two"));
expected = nullptr;
}
value = move(rows[0]);
value = std::move(rows[0]);
REQUIRE(rows.size() == 1);
REQUIRE(bool(expected) == bool(value));
if(expected) {
Expand Down
2 changes: 1 addition & 1 deletion tests/operators/glob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace {
#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
Employee() = default;
Employee(int id, std::string firstName, std::string lastName, float salary, int deptId) :
id{id}, firstName{move(firstName)}, lastName{move(lastName)}, salary{salary}, deptId{deptId} {}
id{id}, firstName{std::move(firstName)}, lastName{std::move(lastName)}, salary{salary}, deptId{deptId} {}
#endif
};
}
Expand Down
2 changes: 1 addition & 1 deletion tests/operators/is_null.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TEST_CASE("Is null") {

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
User() = default;
User(int id, decltype(name) name = nullptr) : id{id}, name{move(name)} {}
User(int id, decltype(name) name = nullptr) : id{id}, name{std::move(name)} {}
#endif
};
auto storage = make_storage(
Expand Down
2 changes: 1 addition & 1 deletion tests/operators/like.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ TEST_CASE("Like operator") {

#ifndef SQLITE_ORM_AGGREGATE_NSDMI_SUPPORTED
User() = default;
User(int id, std::string name) : id{id}, name{move(name)} {}
User(int id, std::string name) : id{id}, name{std::move(name)} {}
#endif
};
struct Pattern {
Expand Down
Loading

0 comments on commit 46469ac

Please sign in to comment.