-
Notifications
You must be signed in to change notification settings - Fork 80
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
Rename concepts to be standard conform #1860
Conversation
907a290
to
3c773c3
Compare
Codecov Report
@@ Coverage Diff @@
## master #1860 +/- ##
=======================================
Coverage 97.62% 97.62%
=======================================
Files 250 250
Lines 9507 9507
=======================================
Hits 9281 9281
Misses 226 226
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question for my understanding and a small commit thing. :)
include/seqan3/std/concepts
Outdated
@@ -378,6 +372,17 @@ template < class T > | |||
SEQAN3_CONCEPT default_constructible = constructible_from<T>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not quite understand the reason why we define two times the same concept and name it differently (line 383). Is it so that the user can still use std::default_constructible
? How will this appear in the Documentation ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, you are completely right. This was incorrect and slipped through. Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright but is this correct: It does not matter wether I use the concept default_constructable or default_initializable ? Because line 383 says both concepts are equal right ?
Also the links lead to the same page:
https://en.cppreference.com/w/cpp/concepts/default_constructible
gets redirected to:
https://en.cppreference.com/w/cpp/concepts/default_initializable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As is, correct.
@marehr What is your thought on this situation? Would it maybe be better, instead of adding the default_initializable
concept like now, to do:
diff --git a/include/seqan3/std/concepts b/include/seqan3/std/concepts
index 112e7307..014a61de 100644
--- a/include/seqan3/std/concepts
+++ b/include/seqan3/std/concepts
@@ -361,17 +361,6 @@ template < class T, class... Args >
SEQAN3_CONCEPT constructible_from = destructible<T> && std::is_constructible_v<T, Args...>;
//!\endcond
-/*!\interface std::default_constructible <>
- * \extends std::constructible_from
- * \brief The std::default_constructible concept provides a shorthand for the common case when the question is whether
- * a type can be constructed with no arguments.
- * \sa https://en.cppreference.com/w/cpp/concepts/default_constructible
- */
-//!\cond
-template < class T >
-SEQAN3_CONCEPT default_constructible = constructible_from<T>;
-//!\endcond
-
/*!\interface std::default_initializable <>
* \extends std::constructible_from
* \brief The std::default_initializable concept provides a shorthand for the common case when the question is whether
@@ -380,7 +369,7 @@ SEQAN3_CONCEPT default_constructible = constructible_from<T>;
*/
//!\cond
template < class T >
-SEQAN3_CONCEPT default_initializable = default_constructible<T>;
+SEQAN3_CONCEPT default_initializable = constructible_from<T>;
//!\endcond
/*!\interface std::move_constructible <>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should be removed :) and replaced with std::default_initializable
Good catch :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh @wvandertoorn your patch already expressed this :) Awesome :)
@@ -244,8 +244,6 @@ inline namespace deprecated | |||
// // [default.sentinels], default sentinels | |||
// struct default_sentinel_t; | |||
// inline constexpr default_sentinel_t default_sentinel{}; | |||
using ::std::default_sentinel_t; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should maybe better be removed in the previous commit (7a241a9) , not sure though. 🧐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely, changed it.
3c773c3
to
ffd6eb3
Compare
ffd6eb3
to
66e3283
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good ! 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
We should mention though in the changelog that the following changed in accordance with the standard: default_constructible -> default_initializable, readable -> indirectly_readable, writable -> indirectly_writable
Some more missing std::ranges::default_sentinel references: |
66e3283
to
3dcca4a
Compare
Wow, that was some confusing rebase fuck-up, sorry.. Fixed and changelog entry added. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one more little change 👍
Well, that is what fun looks like 😆 |
02a5d73
to
fd018ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, many thanks.
Fixes part of seqan/product_backlog#49.
Renaming the stuff that was renamed by the standard or was in the wrong namespace.
std::default_constructible
->std::default_initializable
std::readable
->std::indirectly_readable
std::writable
->std::indirectly_writable
std::back_inserter
->std::cpp20::back_inserter
(back_inserter has a new behaviour since cxx20; it is default initializable)std::ranges::default_sentinel
->std::default_sentinel
(we wrongly assume that these are in std::ranges namespace, even though they are in std namespace)std::ranges::default_sentinel_t
->std::default_sentinel_t
(we wrongly assume that these are in std::ranges namespace, even though they are in std namespace)std::ranges::all_view
->std::views::all_t