-
Notifications
You must be signed in to change notification settings - Fork 82
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
Final refactoring of alphabets #869
Comments
In general I agree. I'm just wondering why we are dropping the std::Regular requirement. How will we adjust all the, e.g., unit tests where we require to default construct a alphabet? |
We don't have to adapt our tests because our alphabets will still be Regular. We just don't require it. The reason was, as discussed in escala, that default constructability is not required by interfaces that only consume alphabets and that it prevents references from modelling the concepts. |
Hm... didn't we have the function style guide for parameters |
No, that was SeqAn2-style. In SeqAn3 it's "natural order" and has been since day 1: |
Then I'm fine with the changes |
So we implicitly require it for our alphabets then.
Ok. I agree with the changes. |
looks good to me. |
is this done? |
Yep |
These are the discussed changes and some smaller additions by me not yet discussed.
@seqan/core please have a look and give me objections ASAP since I want to start working on this very soon.
seqan3::SemialphabetConcept
:std::StrictTotallyOrdered
(order required to respond to ranks)std::Copyable
and requiresstd::is_trivially_copyable
std::Regular
is dropped, but recommended for all type definitionsto_rank
customisation point objectalphabet_size_v
::alphabet_size
(now it's::value_size
– a weird name leftover from SeqAn2)alphabet_size()
which makes it possible to define your own alphabet without overriding the metafunction in SeqAnseqan3::WritableSemialphabetConcept
:seqan3::SemialphabetConcept
assign_rank_to(rank, alph)
customisation point objectassign_rank(alph, rank)
in seqan2-(target, source)-style; new style is more intuitive and allows forassign_rank_to<dna5>(rank)
instead of explicit constructionassign_rank(dna5{}, rank)
[also necessary because we don't require regularity anymore]assign_rank(rank)
member functionassign_rank_to(rank, alph)
free function via ADLassign_rank_to(rank, alph &&)
so this does not have to be customised (only the overload for lvalue-references has to be customised).seqan3::AlphabetConcept
seqan3::SemialphabetConcept
to_char
customisation point analogous to aboveseqan3::WritableAlphabetConcept
seqan3::AlphabetConcept
andseqan3::WritableSemialphabetConcept
assign_char_to(char, alph)
customisation point object analogous toassign_rank_to(rank, alph)
PLUS
Constexpr
versions of all of the above inseqan3::detail::
.Note that
underlying_rank_t
andunderlying_char_t
will be renamed toalphabet_rank_t
andalphabet_char_t
and will not be customisation points, they always resolve to the return type ofto_char()
and `to_rank().rename
alphabet_size_v
->alphabet_size
rename
::value_size
->alphabet_size
The text was updated successfully, but these errors were encountered: