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

cxx20: return-type-requirement is not a type-constraint #88

Closed
12 tasks
marehr opened this issue May 18, 2020 · 0 comments · Fixed by seqan/seqan3#1866
Closed
12 tasks

cxx20: return-type-requirement is not a type-constraint #88

marehr opened this issue May 18, 2020 · 0 comments · Fixed by seqan/seqan3#1866
Assignees
Labels
ready to tackle This story was discussed and can be immidietly tackled
Milestone

Comments

@marehr
Copy link
Member

marehr commented May 18, 2020

Description

The following expression

template <typename t>
concept semialphabet = requires (t v)
{
    { seqan3::to_rank(v) } -> seqan3::alphabet_rank_t<t>;
}

is invalid starting with C++20.

In C++20 you would use the following expression :

template <typename t>
concept semialphabet = requires (t v)
{
    { seqan3::to_rank(v) } -> std::convertible_to<seqan3::alphabet_rank_t<t>>;
};

(The return type needs a concept requirement)

The problem is that gcc 7 and 8 does not support the C++20 syntax.

A compromise that works for every compiler version is

template <typename t>
concept semialphabet = requires (t v)
{
    requires std::convertible_to<delctype(seqan3::to_rank(v)), seqan3::alphabet_rank_t<t>>;
};

Acceptance Criteria

  • Replaced most of these occurrences by the compromise solution

Tasks

  • task 1
  • task 2
  • task 3

Definition of Done

  • Implementation and design approved
  • Unit tests pass
  • Test coverage = 100%
  • Microbenchmarks added and/or affected microbenchmarks < 5% performance drop
  • API documentation added
  • Tutorial/teaching material added
  • Test suite compiles in less than 30 seconds (on travis)
  • Changelog entry added
@marehr marehr added the ready to tackle This story was discussed and can be immidietly tackled label May 18, 2020
@marehr marehr self-assigned this May 18, 2020
@marehr marehr mentioned this issue May 18, 2020
36 tasks
@marehr marehr mentioned this issue May 27, 2020
21 tasks
marehr added a commit to marehr/seqan3 that referenced this issue May 31, 2020
This PR fixes seqan/product_backlog#88, please
see further explanations in that issue.

With regex: "\{[ ]*(.+?)\s*\}\s*->\s*(.+);" and replace "requires std::same_as<decltype($1), $2>;"
marehr added a commit to marehr/seqan3 that referenced this issue May 31, 2020
This PR fixes seqan/product_backlog#88, please
see further explanations in that issue.

With regex: "\{[ ]*(.+?)\s*\}\s*->\s*(.+);" and replace "requires std::same_as<decltype($1), $2>;"
@rrahn rrahn added this to the Sprint 5 milestone Jun 2, 2020
marehr added a commit to marehr/seqan3 that referenced this issue Jun 8, 2020
This PR fixes seqan/product_backlog#88, please
see further explanations in that issue.

With regex: "\{[ ]*(.+?)\s*\}\s*->\s*(.+);" and replace "requires std::same_as<decltype($1), $2>;"
marehr added a commit to marehr/seqan3 that referenced this issue Jun 9, 2020
This PR fixes seqan/product_backlog#88, please
see further explanations in that issue.

With regex: "\{[ ]*(.+?)\s*\}\s*->\s*(.+);" and replace "requires std::same_as<decltype($1), $2>;"
marehr added a commit to marehr/seqan3 that referenced this issue Jun 12, 2020
This PR fixes seqan/product_backlog#88, please
see further explanations in that issue.

With regex: "\{[ ]*(.+?)\s*\}\s*->\s*(.+);" and replace "requires std::same_as<decltype($1), $2>;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to tackle This story was discussed and can be immidietly tackled
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants