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

[INFRA] Drop gcc9 #2952

Merged
merged 22 commits into from
Mar 31, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,11 @@ concept writable_aligned_sequence =
requires (t v, detail::unaligned_seq_t<t> unaligned)
{
// global functions for generic usability
SEQAN3_RETURN_TYPE_CONSTRAINT(insert_gap(v, std::ranges::begin(v)), std::same_as, std::ranges::iterator_t<t>);
SEQAN3_RETURN_TYPE_CONSTRAINT(insert_gap(v, std::ranges::begin(v), 2),
std::same_as, std::ranges::iterator_t<t>);
SEQAN3_RETURN_TYPE_CONSTRAINT(erase_gap(v, std::ranges::begin(v)), std::same_as, std::ranges::iterator_t<t>);
SEQAN3_RETURN_TYPE_CONSTRAINT(erase_gap(v, std::ranges::begin(v), std::ranges::end(v)),
std::same_as, std::ranges::iterator_t<t>);
SEQAN3_RETURN_TYPE_CONSTRAINT(assign_unaligned(v, unaligned), std::same_as, void);
{insert_gap(v, std::ranges::begin(v))} -> std::same_as<std::ranges::iterator_t<t>>;
{insert_gap(v, std::ranges::begin(v), 2)} -> std::same_as<std::ranges::iterator_t<t>>;
{erase_gap(v, std::ranges::begin(v))} -> std::same_as<std::ranges::iterator_t<t>>;
{erase_gap(v, std::ranges::begin(v), std::ranges::end(v))} -> std::same_as<std::ranges::iterator_t<t>>;
{assign_unaligned(v, unaligned)} -> std::same_as<void>;
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks so much nicer now!

};
//!\endcond

Expand Down
7 changes: 3 additions & 4 deletions include/seqan3/alignment/matrix/detail/matrix_concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,21 @@ concept matrix = requires(std::remove_cvref_t<matrix_t> m)
* \brief The number of columns in the matrix.
*/
//!\cond
SEQAN3_RETURN_TYPE_CONSTRAINT(m.cols(), std::same_as, typename std::remove_cvref_t<matrix_t>::size_type);
{m.cols()} -> std::same_as<typename std::remove_cvref_t<matrix_t>::size_type>;
//!\endcond

/*!\fn size_type rows() const noexcept;
* \brief The number of rows in the matrix.
*/
//!\cond
SEQAN3_RETURN_TYPE_CONSTRAINT(m.rows(), std::same_as, typename std::remove_cvref_t<matrix_t>::size_type);
{m.rows()} -> std::same_as<typename std::remove_cvref_t<matrix_t>::size_type>;
//!\endcond

/*!\fn reference at(matrix_coordinate coordinate) noexcept;
* \brief A reference to the entry of the matrix at the given coordinate.
*/
//!\cond
SEQAN3_RETURN_TYPE_CONSTRAINT(m.at(matrix_coordinate{}),
std::same_as, typename std::remove_cvref_t<matrix_t>::reference);
{m.at(matrix_coordinate{})} -> std::same_as<typename std::remove_cvref_t<matrix_t>::reference>;
//!\endcond

//!\cond
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,14 @@ concept two_dimensional_matrix_iterator =
{ it.coordinate() };
{ cit.coordinate() };

SEQAN3_RETURN_TYPE_CONSTRAINT(it += offset, std::same_as, std::remove_reference_t<iter_t> &);
SEQAN3_RETURN_TYPE_CONSTRAINT(it + offset, std::same_as, std::remove_reference_t<iter_t>);
SEQAN3_RETURN_TYPE_CONSTRAINT(offset + it, std::same_as, std::remove_reference_t<iter_t>);
SEQAN3_RETURN_TYPE_CONSTRAINT(it -= offset, std::same_as, std::remove_reference_t<iter_t> &);
SEQAN3_RETURN_TYPE_CONSTRAINT(it - offset, std::same_as, std::remove_reference_t<iter_t>);
SEQAN3_RETURN_TYPE_CONSTRAINT(cit - offset, std::same_as, std::remove_reference_t<iter_t>);
SEQAN3_RETURN_TYPE_CONSTRAINT(it.coordinate(), std::same_as, matrix_coordinate);
SEQAN3_RETURN_TYPE_CONSTRAINT(cit.coordinate(), std::same_as, matrix_coordinate);
{it += offset} -> std::same_as<std::remove_reference_t<iter_t> &>;
{it + offset} -> std::same_as<std::remove_reference_t<iter_t>>;
{offset + it} -> std::same_as<std::remove_reference_t<iter_t>>;
{it -= offset} -> std::same_as<std::remove_reference_t<iter_t> &>;
{it - offset} -> std::same_as<std::remove_reference_t<iter_t>>;
{cit - offset} -> std::same_as<std::remove_reference_t<iter_t>>;
{it.coordinate()} -> std::same_as<matrix_coordinate>;
{cit.coordinate()} -> std::same_as<matrix_coordinate>;
};
//!\endcond
} // namespace seqan3::detail
5 changes: 2 additions & 3 deletions include/seqan3/alphabet/concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,9 +736,8 @@ struct assign_char_strictly_to_fn
//!\cond
requires requires ()
{
SEQAN3_RETURN_TYPE_CONSTRAINT(seqan3::assign_char_to(chr, std::forward<alphabet_t>(alphabet)),
std::convertible_to, alphabet_t);
SEQAN3_RETURN_TYPE_CONSTRAINT(seqan3::char_is_valid_for<alphabet_t>(chr), std::same_as, bool);
{seqan3::assign_char_to(chr, std::forward<alphabet_t>(alphabet))} -> std::convertible_to<alphabet_t>;
{seqan3::char_is_valid_for<alphabet_t>(chr)} -> std::same_as<bool>;
}
//!\endcond
{
Expand Down
4 changes: 1 addition & 3 deletions include/seqan3/argument_parser/detail/format_parse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,7 @@ class format_parse : public format_base
typename container_option_t::value_type & container_value,
std::string const & in)
{
SEQAN3_RETURN_TYPE_CONSTRAINT(fp.parse_option_value(container_value, in),
std::same_as,
option_parse_result);
{fp.parse_option_value(container_value, in)} -> std::same_as<option_parse_result>;
}
//!\endcond
option_parse_result parse_option_value(container_option_t & value, std::string const & in)
Expand Down
4 changes: 2 additions & 2 deletions include/seqan3/argument_parser/validators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ concept validator = std::copyable<std::remove_cvref_t<validator_type>> &&
{
typename std::remove_reference_t<validator_type>::option_value_type;

SEQAN3_RETURN_TYPE_CONSTRAINT(validator(value), std::same_as, void);
SEQAN3_RETURN_TYPE_CONSTRAINT(validator.get_help_page_message(), std::same_as, std::string);
{validator(value)} -> std::same_as<void>;
{validator.get_help_page_message()} -> std::same_as<std::string>;
};
//!\endcond

Expand Down
9 changes: 0 additions & 9 deletions include/seqan3/core/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@
# include <version>
#endif

//!\brief Same as writing `{expression} -> concept_name<type1[, ...]>` in a concept definition.
#if defined(__GNUC__) && (__GNUC__ < 10)
# define SEQAN3_RETURN_TYPE_CONSTRAINT(expression, concept_name, ...) \
{expression}; requires concept_name<decltype(expression), __VA_ARGS__>
#else
# define SEQAN3_RETURN_TYPE_CONSTRAINT(expression, concept_name, ...) \
{expression} -> concept_name<__VA_ARGS__>
#endif

// ============================================================================
// Dependencies
// ============================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class inherited_iterator_base : public std::conditional_t<std::is_pointer_v<base
constexpr derived_t operator++(int) noexcept(noexcept(std::declval<base_t &>()++) &&
noexcept(derived_t(std::declval<base_t &>())))
//!\cond
requires requires (base_t_ i) { i++; SEQAN3_RETURN_TYPE_CONSTRAINT(i++, std::same_as, base_t_); } &&
requires requires (base_t_ i) { i++; {i++} -> std::same_as<base_t_>; } &&
Copy link
Contributor

Choose a reason for hiding this comment

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

can't we leave the first i++ away?
requires requires (base_t_ i) { {i++} -> std::same_as<base_t_>; } &&

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe, but I wouldn't change the concept in this PR.
Theoretically, it first checks whether i++ is valid, and then whether it returns the correct type. The first i++ is probably not needed.

std::constructible_from<derived_t, base_t_>
//!\endcond
{
Expand Down
37 changes: 18 additions & 19 deletions include/seqan3/io/sam_file/output_format_concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,25 +98,24 @@ concept sam_file_output_format =
{
t::file_extensions;

SEQAN3_RETURN_TYPE_CONSTRAINT(v.write_alignment_record(stream,
options,
header,
seq,
qual,
id,
offset,
ref_seq,
ref_id,
ref_offset,
align,
cigar,
flag,
mapq,
mate,
tag_dict,
e_value,
bit_score),
std::same_as, void);
{v.write_alignment_record(stream,
options,
header,
seq,
qual,
id,
offset,
ref_seq,
ref_id,
ref_offset,
align,
cigar,
flag,
mapq,
mate,
tag_dict,
e_value,
bit_score)} -> std::same_as<void>;
};
//!\endcond

Expand Down
14 changes: 3 additions & 11 deletions include/seqan3/io/sequence_file/input_format_concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,9 @@ concept sequence_file_input_format = requires (detail::sequence_file_input_forma
{
t::file_extensions;

SEQAN3_RETURN_TYPE_CONSTRAINT(v.read_sequence_record(f, options, position_buffer, seq, id, qual),
std::same_as, void);
SEQAN3_RETURN_TYPE_CONSTRAINT(v.read_sequence_record(f, options, position_buffer, seq_qual, id, seq_qual),
std::same_as, void);
SEQAN3_RETURN_TYPE_CONSTRAINT(v.read_sequence_record(f,
options,
position_buffer,
std::ignore,
std::ignore,
std::ignore),
std::same_as, void);
{v.read_sequence_record(f, options, position_buffer, seq, id, qual)} -> std::same_as<void>;
{v.read_sequence_record(f, options, position_buffer, seq_qual, id, seq_qual)} -> std::same_as<void>;
{v.read_sequence_record(f, options, position_buffer, std::ignore, std::ignore, std::ignore)} -> std::same_as<void>;
};
//!\endcond

Expand Down
8 changes: 3 additions & 5 deletions include/seqan3/io/sequence_file/output_format_concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ concept sequence_file_output_format = requires (detail::sequence_file_output_for
{
t::file_extensions;

SEQAN3_RETURN_TYPE_CONSTRAINT(v.write_sequence_record(f, options, seq, id, qual), std::same_as, void);
SEQAN3_RETURN_TYPE_CONSTRAINT(v.write_sequence_record(f, options, std::ignore, id, std::ignore),
std::same_as, void);
SEQAN3_RETURN_TYPE_CONSTRAINT(v.write_sequence_record(f, options, std::ignore, std::ignore, std::ignore),
std::same_as, void);
{v.write_sequence_record(f, options, seq, id, qual)} -> std::same_as<void>;
{v.write_sequence_record(f, options, std::ignore, id, std::ignore)} -> std::same_as<void>;
{v.write_sequence_record(f, options, std::ignore, std::ignore, std::ignore)} -> std::same_as<void>;
// the last is required to be compile time valid, but should always throw at run-time.
};
//!\endcond
Expand Down
12 changes: 4 additions & 8 deletions include/seqan3/io/stream/concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ concept output_stream_over = std::is_base_of_v<std::ios_base, std::remove_refere
typename std::remove_reference_t<stream_type>::pos_type;
typename std::remove_reference_t<stream_type>::off_type;

SEQAN3_RETURN_TYPE_CONSTRAINT(os << val,
std::same_as,
std::basic_ostream<typename std::remove_reference_t<stream_type>::char_type,
typename std::remove_reference_t<stream_type>::traits_type> &);
{os << val} -> std::same_as<std::basic_ostream<typename std::remove_reference_t<stream_type>::char_type,
typename std::remove_reference_t<stream_type>::traits_type> &>;
};

template <typename stream_type>
Expand Down Expand Up @@ -109,10 +107,8 @@ concept input_stream_over = std::is_base_of_v<std::ios_base, std::remove_referen
typename std::remove_reference_t<stream_type>::off_type;


SEQAN3_RETURN_TYPE_CONSTRAINT(is >> val,
std::same_as,
std::basic_istream<typename std::remove_reference_t<stream_type>::char_type,
typename std::remove_reference_t<stream_type>::traits_type> &);
{is >> val} -> std::same_as<std::basic_istream<typename std::remove_reference_t<stream_type>::char_type,
typename std::remove_reference_t<stream_type>::traits_type> &>;
};

template <typename stream_type>
Expand Down
95 changes: 47 additions & 48 deletions include/seqan3/io/structure_file/input_format_concept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,54 +86,53 @@ concept structure_file_input_format = requires(detail::structure_file_input_form
{
t::file_extensions;

SEQAN3_RETURN_TYPE_CONSTRAINT(v.read_structure_record(f,
options,
seq,
id,
bpp,
structure,
energy,
react,
react_err,
comment,
offset),
std::same_as, void);
SEQAN3_RETURN_TYPE_CONSTRAINT(v.read_structure_record(f,
options,
seq,
id,
bpp,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore),
std::same_as, void);
SEQAN3_RETURN_TYPE_CONSTRAINT(v.read_structure_record(f,
options,
structured_seq,
id,
std::ignore,
structured_seq,
energy,
std::ignore,
std::ignore,
std::ignore,
std::ignore),
std::same_as, void);
SEQAN3_RETURN_TYPE_CONSTRAINT(v.read_structure_record(f,
options,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore),
std::same_as, void);
{v.read_structure_record(f,
options,
seq,
id,
bpp,
structure,
energy,
react,
react_err,
comment,
offset)} -> std::same_as<void>;

{v.read_structure_record(f,
options,
seq,
id,
bpp,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore)} -> std::same_as<void>;

{v.read_structure_record(f,
options,
structured_seq,
id,
std::ignore,
structured_seq,
energy,
std::ignore,
std::ignore,
std::ignore,
std::ignore)} -> std::same_as<void>;

{v.read_structure_record(f,
options,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore,
std::ignore)} -> std::same_as<void>;
// the last is required to be compile time valid, but should always throw at run-time.
};
//!\endcond
Expand Down
Loading