Skip to content

Commit

Permalink
[MISC] seqan3::range_compatible deprecation should be concept-like (#…
Browse files Browse the repository at this point in the history
…2461)

* [MISC] seqan3::range_compatible deprecation should be concept-like

This PR makes the old seqan3::range_compatible concept (change made in
aa1ed00) work again with false inputs
(SFINAE-friendly).

Before, `seqan3::range_compatible<int, int>` gave a hard compiler
error.

This makes the upgrade-path from 3.0.2 to 3.0.3 easier.

* Update CHANGELOG.md

Co-authored-by: Enrico Seiler <[email protected]>
  • Loading branch information
marehr and eseiler authored Mar 23, 2021
1 parent 692f234 commit e616011
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ If possible, provide tooling that performs the changes, e.g. a shell-script.
* `seqan3::option_spec::ADVANCED` is replaced by `seqan3::option_spec::advanced`.
* `seqan3::option_spec::HIDDEN` is replaced by `seqan3::option_spec::hidden`.

#### Core

* We deprecated seqan3::range_compatible_concept and it will be removed in 3.1.0
([\#2265](https://github.com/seqan/seqan3/pull/2265)).

#### I/O

* Renamed seqan3::alignment_file\* to seqan3::sam_file\*
Expand Down
18 changes: 14 additions & 4 deletions include/seqan3/core/range/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,18 +269,28 @@ constexpr size_t range_dimension_v<t> = range_dimension_v<std::ranges::range_val
// range_compatible [DEPRECATED]
// ----------------------------------------------------------------------------

#ifdef SEQAN3_DEPRECATED_310
/*!\interface seqan3::range_compatible <>
* \brief Two types are "compatible" if their seqan3::range_dimension_v and their seqan3::range_innermost_value_t are
* the same.
* \deprecated This concept is deprecated and will be removed in SeqAn-3.1.
*/
//!\cond
namespace deprecated
{
template <typename t1, typename t2>
SEQAN3_CONCEPT range_compatible_concept = requires (t1, t2)
{
requires (range_dimension_v<t1> == range_dimension_v<t2>);

requires std::is_same_v<range_innermost_value_t<t1>, range_innermost_value_t<t2>>;
};
} // namespace seqan3::deprecated

template <typename t1, typename t2>
SEQAN3_DEPRECATED_310 constexpr bool range_compatible = (
std::is_same_v<range_innermost_value_t<t1>, range_innermost_value_t<t2>> &&
range_dimension_v<t1> == range_dimension_v<t2>
);
SEQAN3_DEPRECATED_310 constexpr bool range_compatible = deprecated::range_compatible_concept<t1, t2>;
//!\endcond
#endif // SEQAN3_DEPRECATED_310

//!\}

Expand Down

1 comment on commit e616011

@vercel
Copy link

@vercel vercel bot commented on e616011 Mar 23, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.