Skip to content

Commit 43d3103

Browse files
committed
Implemented suggestions made during the review
1 parent 68ba295 commit 43d3103

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

dev/function.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,10 @@ namespace sqlite_orm {
325325
*/
326326
template<typename UDF, typename... CallArgs>
327327
#ifdef SQLITE_ORM_RELAXED_CONSTEXPR_SUPPORTED
328-
SQLITE_ORM_CONSTEVAL
328+
SQLITE_ORM_CONSTEVAL void check_function_call() {
329+
#else
330+
void check_function_call() {
329331
#endif
330-
void
331-
check_function_call() {
332332
using call_args_tuple = std::tuple<CallArgs...>;
333333
using function_params_tuple = typename callable_arguments<UDF>::args_tuple;
334334
constexpr size_t callArgsCount = std::tuple_size<call_args_tuple>::value;

include/sqlite_orm/sqlite_orm.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12949,10 +12949,10 @@ namespace sqlite_orm {
1294912949
*/
1295012950
template<typename UDF, typename... CallArgs>
1295112951
#ifdef SQLITE_ORM_RELAXED_CONSTEXPR_SUPPORTED
12952-
SQLITE_ORM_CONSTEVAL
12952+
SQLITE_ORM_CONSTEVAL void check_function_call() {
12953+
#else
12954+
void check_function_call() {
1295312955
#endif
12954-
void
12955-
check_function_call() {
1295612956
using call_args_tuple = std::tuple<CallArgs...>;
1295712957
using function_params_tuple = typename callable_arguments<UDF>::args_tuple;
1295812958
constexpr size_t callArgsCount = std::tuple_size<call_args_tuple>::value;

tests/user_defined_functions.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ struct MeanFunction {
8080
double total = 0;
8181
int count = 0;
8282

83-
static int wasInstantiatedCount;
83+
static int ctorCallsCount;
8484
static int objectsCount;
8585

8686
MeanFunction() {
87-
++wasInstantiatedCount;
87+
++ctorCallsCount;
8888
++objectsCount;
8989
}
9090

@@ -108,7 +108,7 @@ struct MeanFunction {
108108
}
109109
};
110110

111-
int MeanFunction::wasInstantiatedCount = 0;
111+
int MeanFunction::ctorCallsCount = 0;
112112
int MeanFunction::objectsCount = 0;
113113

114114
struct FirstFunction {
@@ -415,12 +415,12 @@ TEST_CASE("custom functions") {
415415
// expect two different aggregate function objects to be created, which provide two different results;
416416
// This ensures that `proxy_get_aggregate_step_udf()` uses `sqlite3_aggregate_context()` correctly
417417
{
418-
MeanFunction::wasInstantiatedCount = 0;
418+
MeanFunction::ctorCallsCount = 0;
419419
REQUIRE(MeanFunction::objectsCount == 0);
420-
REQUIRE(MeanFunction::wasInstantiatedCount == 0);
420+
REQUIRE(MeanFunction::ctorCallsCount == 0);
421421
auto rows = storage.select(columns(func<MeanFunction>(&User::id), func<MeanFunction>(c(&User::id) * 2)));
422422
REQUIRE(MeanFunction::objectsCount == 0);
423-
REQUIRE(MeanFunction::wasInstantiatedCount == 2);
423+
REQUIRE(MeanFunction::ctorCallsCount == 2);
424424
REQUIRE(int(std::get<0>(rows[0])) == 2);
425425
REQUIRE(int(std::get<1>(rows[0])) == 4);
426426
}

0 commit comments

Comments
 (0)