Skip to content

Commit

Permalink
[FIX] gcc-11: satisfaction of atomic constraint depends on itself (#2576
Browse files Browse the repository at this point in the history
)

* [FIX] gcc-11: satisfaction of atomic constraint depends on itself

Fixes seqan/product_backlog#371

* Update bitcompressed_vector.hpp

* Apply suggestions from code review

* Update include/seqan3/range/container/bitcompressed_vector.hpp

* Apply suggestions from code review

* Update include/seqan3/range/container/bitcompressed_vector.hpp

* Update test/unit/range/container/bitcompressed_vector_test.cpp

Co-authored-by: Enrico Seiler <[email protected]>

Co-authored-by: Enrico Seiler <[email protected]>
  • Loading branch information
marehr and eseiler authored Apr 29, 2021
1 parent 42ae7d1 commit fcad6ef
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/seqan3/range/container/bitcompressed_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,11 @@ class bitcompressed_vector
*
* \experimentalapi{Experimental since version 3.1. This is a non-standard C++ extension.}
*/
template <std::ranges::input_range other_range_t>
template <typename other_range_t>
//!\cond
requires has_same_value_type_v<other_range_t>
requires (!std::same_as<bitcompressed_vector, std::remove_cvref_t<other_range_t>>) &&
std::ranges::input_range<other_range_t> &&
has_same_value_type_v<other_range_t>
//!\endcond
explicit bitcompressed_vector(other_range_t && range) :
bitcompressed_vector{std::ranges::begin(range), std::ranges::end(range)}
Expand Down
12 changes: 12 additions & 0 deletions test/unit/range/container/bitcompressed_vector_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

#include <gtest/gtest.h>

#include <seqan3/alphabet/composite/alphabet_variant.hpp>
#include <seqan3/alphabet/nucleotide/concept.hpp>
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/alphabet/nucleotide/dna15.hpp>
#include <seqan3/alphabet/views/complement.hpp>
#include <seqan3/range/container/bitcompressed_vector.hpp>
#include <seqan3/test/expect_range_eq.hpp>
Expand Down Expand Up @@ -39,3 +41,13 @@ TEST(bitcompressed_vector_test, issue1743_view_combinability)
EXPECT_EQ(v.size(), complement.size());
EXPECT_RANGE_EQ(complement, (seqan3::dna4_vector{'T'_dna4, 'G'_dna4, 'C'_dna4, 'A'_dna4}));
}

// https://github.com/seqan/product_backlog/issues/371
TEST(bitcompressed_vector_test, issue371)
{
using alphabet_t = seqan3::alphabet_variant<seqan3::dna4, seqan3::dna15>;
seqan3::bitcompressed_vector<alphabet_t> source{};
auto it = source.begin();
auto end = source.end();
it != end; // This line causes error.
}

1 comment on commit fcad6ef

@vercel
Copy link

@vercel vercel bot commented on fcad6ef Apr 29, 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.