Skip to content

Conversation

@sdebionne
Copy link
Contributor

Description

Switch Point concept from Boost.ConceptCheck to C++20 concepts.

References

Discussed on boost-gil cpplang

Tasklist

  • Adapt test case(s)
  • Ensure all CI builds pass
  • Review and approve

@sdebionne sdebionne self-assigned this Jan 23, 2026
@sdebionne sdebionne added the cat/refactoring Any nonfunctional changes label Jan 23, 2026
@sdebionne sdebionne requested a review from mloskot January 23, 2026 11:47
@sdebionne
Copy link
Contributor Author

I am not sure what to do with the CI. Obviously all builds with cxxstd < 20 will fail.

///
template <typename P>
struct PointNDConcept
concept PointNDConcept = requires(P point, typename P::template axis<0>::coord_t ft, typename P::template axis<P::num_dimensions - 1>::coord_t lt)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

concept should be lower case?

}
P point;
typename P::value_type;
requires std::regular<typename P::value_type>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Better write with concept conjunctions?

concept PointNDConcept = std::regular<typename P::value_type> && requires(P point, typename...

@mloskot
Copy link
Member

mloskot commented Jan 23, 2026

Obviously all builds with cxxstd < 20 will fail.

Well, any build other than c++20 will fail, no?

Since GIL cannot afford the luxury of https://github.com/boostorg/cobalt, I don't know any tricks other than the old-school
https://github.com/boostorg/url/blob/f4a80080b1012a0f0a7fb6cd472ff662fa8daefe/include/boost/url/grammar/charset.hpp#L69

@sdebionne
Copy link
Contributor Author

Right, another option would be GIL v2.

@mloskot
Copy link
Member

mloskot commented Jan 24, 2026

If we would be allowed to consider GIL up to Boost 1.90 as last GIL that supports mixture of older and newer compilers, and any GIL released after Boost 1.90 require >= C++20, that would be great! It would be an opportunity for more thorough refactoring and better experience for implementing new features.

@sdebionne
Copy link
Contributor Author

If we would be allowed to consider...

Is it our decision or shall we ask the community or a boost comity for advise? Would that involve a review process?

I fully agree that much of the code of the library could be re-written in a simpler way with the new language feature (e.g. one-liner lambda instead of function object).

For me, getting a meaningful compiler error message when using GIL instead of a gigantic stack of errors would be a huge improvement. Maybe I am wrong but I hope that the switch to C++20 concepts should help.

In the meantime, I can try to keep the compatibility to see what that involves in term of added complexity and boilerplate.

@mloskot
Copy link
Member

mloskot commented Jan 26, 2026

Is it our decision or shall we ask the community or a boost comity for advise? Would that involve a review process?

@sdebionne Good questions. Trying to learn about it on the Slack.

@sdebionne sdebionne force-pushed the cxx20-concept-point branch from 319a6a2 to 8cc2a45 Compare January 27, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat/refactoring Any nonfunctional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants