Skip to content

Improving quoted functions et al #1440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jun 8, 2025
Merged

Improving quoted functions et al #1440

merged 13 commits into from
Jun 8, 2025

Conversation

trueqbit
Copy link
Collaborator

@trueqbit trueqbit commented Jun 7, 2025

This PR improves the handling of scalar application-defined functions from quoted functions and those with a static call operator.

  • Support for static call operators (of quoted lambdas and function objects, and of traditional scalar function classes).
  • Overloaded call operators are now picked by the explicitly specified signature. [Note: This was partially done before at the point when creating the quoted function. It is now picked as well when invoking the actual call operator. This also restores a deleted type alias as a proper static assertion.]
  • Added unit tests for scalar functions with static call operators.

Additionally:

  • Added an example of a quoted application-defined function.
  • Simplified tuple from boxed SQLite values.
  • CMake: Fallback to C++17 if no explicit C++ standard is requested.
  • CMake: Added build variable to request C++26

trueqbit added 6 commits June 7, 2025 10:55
* Support for static call operators (of lambdas and function objects)
* Overloaded call operators are now picked by the explicitly specified signature. Note: This was partially done before at the point when creating the quoted function. It is now picked as well when calling the actual call operator.
@trueqbit trueqbit requested a review from fnc12 June 7, 2025 20:06
#ifdef SQLITE_ORM_CONTRACTS_SUPPORTED
contract_assert(nValues == std::tuple_size<Tpl>::value);
#else
(void)nValues;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd use std::ignore to make it more modern

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. I am not convinced this is the right usage of ignore. It should only be used for ignoring results (of functions).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well nobody prohibits doing it =)

@trueqbit trueqbit force-pushed the quoted_functions_et_al branch from 9f38a1d to 3251689 Compare June 8, 2025 12:24
@trueqbit trueqbit force-pushed the quoted_functions_et_al branch from 3251689 to 4351c9c Compare June 8, 2025 14:12
@trueqbit trueqbit merged commit 9ef8bb2 into dev Jun 8, 2025
3 checks passed
@trueqbit trueqbit deleted the quoted_functions_et_al branch June 8, 2025 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants