Skip to content

Commit

Permalink
Simplified code for quoting a freestanding function as a scalar
Browse files Browse the repository at this point in the history
  • Loading branch information
trueqbit committed Nov 24, 2023
1 parent e6f6293 commit 35dceeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
12 changes: 1 addition & 11 deletions dev/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,17 +411,7 @@ namespace sqlite_orm {
using cstring_literal<N>::cstring_literal;

/*
* From a freestanding function.
*/
template<class F>
requires(std::is_function_v<std::remove_pointer_t<F>>)
[[nodiscard]] consteval auto quote(F callable) const {
using Sig = function_signature_type_t<F>;
return quoted_scalar_function<F, Sig, N>{this->cstr, std::move(callable)};
}

/*
* From an overloaded freestanding function.
* From a freestanding function, possibly overloaded.
*/
template<orm_function_sig F>
[[nodiscard]] consteval auto quote(F* callable) const {
Expand Down
12 changes: 1 addition & 11 deletions include/sqlite_orm/sqlite_orm.h
Original file line number Diff line number Diff line change
Expand Up @@ -11399,17 +11399,7 @@ namespace sqlite_orm {
using cstring_literal<N>::cstring_literal;

/*
* From a freestanding function.
*/
template<class F>
requires(std::is_function_v<std::remove_pointer_t<F>>)
[[nodiscard]] consteval auto quote(F callable) const {
using Sig = function_signature_type_t<F>;
return quoted_scalar_function<F, Sig, N>{this->cstr, std::move(callable)};
}

/*
* From an overloaded freestanding function.
* From a freestanding function, possibly overloaded.
*/
template<orm_function_sig F>
[[nodiscard]] consteval auto quote(F* callable) const {
Expand Down

0 comments on commit 35dceeb

Please sign in to comment.