Skip to content
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

Modernize fitness concept definition #2

Open
morinim opened this issue Dec 15, 2023 · 0 comments
Open

Modernize fitness concept definition #2

morinim opened this issue Dec 15, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@morinim
Copy link
Owner

morinim commented Dec 15, 2023

template<class F> concept Fitness =
  OrderedArithmeticType<F>
  && (std::ranges::sized_range<F> || (requires { requires F(-1) < F(0); }));

should be changed with:

template<class F> concept Fitness = OrderedArithmeticType<F> && requires { requires F{-1} < F{0}; };

This, in turn, requires constexpr constructor:

constexpr fitnd(std::initializer_list<double>);

C++20 supports this feature but a very recent version of the compiler is required.

The new definition is simpler and more powerful (extending ordering check to multi dimensional fitness types).

@morinim morinim added the enhancement New feature or request label Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant