Skip to content

Commit 76932a0

Browse files
Remove unused IterConcept from iterator_interface
1 parent 75a090b commit 76932a0

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

include/beman/any_view/detail/iterator.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,12 @@ class iterator {
3333
static constexpr bool random_access = std::derived_from<IterConceptT, std::random_access_iterator_tag>;
3434
static constexpr bool contiguous = std::derived_from<IterConceptT, std::contiguous_iterator_tag>;
3535

36-
using interface_type = iterator_interface<IterConceptT, ElementT, RefT, RValueRefT, DiffT>;
36+
using interface_type = iterator_interface<ElementT, RefT, RValueRefT, DiffT>;
3737
// inplace storage sufficient for a vtable pointer and two pointers
3838
intrusive_small_ptr<interface_type, 3 * sizeof(void*)> iterator_ptr;
3939

4040
template <class IteratorT, class SentinelT>
41-
using adaptor_type =
42-
detail::iterator_adaptor<IterConceptT, ElementT, reference, rvalue_reference, DiffT, IteratorT, SentinelT>;
41+
using adaptor_type = detail::iterator_adaptor<ElementT, reference, rvalue_reference, DiffT, IteratorT, SentinelT>;
4342

4443
template <class IteratorT, class SentinelT>
4544
static constexpr auto get_noexcept() {

include/beman/any_view/detail/iterator_adaptor.hpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,27 @@
1111

1212
namespace beman::any_view::detail {
1313

14-
template <class IterConceptT,
15-
class ElementT,
14+
template <class ElementT,
1615
class RefT,
1716
class RValueRefT,
1817
class DiffT,
1918
std::input_or_output_iterator IteratorT,
2019
std::sentinel_for<IteratorT> SentinelT>
21-
class iterator_adaptor : public iterator_interface<IterConceptT, ElementT, RefT, RValueRefT, DiffT> {
20+
class iterator_adaptor : public iterator_interface<ElementT, RefT, RValueRefT, DiffT> {
2221
[[no_unique_address]] IteratorT iterator;
2322
[[no_unique_address]] SentinelT sentinel;
2423

25-
using iterator_interface = detail::iterator_interface<IterConceptT, ElementT, RefT, RValueRefT, DiffT>;
24+
using iterator_interface = detail::iterator_interface<ElementT, RefT, RValueRefT, DiffT>;
2625
using pointer = std::add_pointer_t<RefT>;
2726

2827
static constexpr auto get_noexcept() {
2928
return std::is_nothrow_move_constructible_v<IteratorT> and std::is_nothrow_move_constructible_v<SentinelT>;
3029
}
3130

32-
static constexpr bool forward = std::derived_from<IterConceptT, std::forward_iterator_tag>;
33-
static constexpr bool bidirectional = std::derived_from<IterConceptT, std::bidirectional_iterator_tag>;
34-
static constexpr bool random_access = std::derived_from<IterConceptT, std::random_access_iterator_tag>;
35-
static constexpr bool contiguous = std::derived_from<IterConceptT, std::contiguous_iterator_tag>;
31+
static constexpr bool forward = std::forward_iterator<IteratorT>;
32+
static constexpr bool bidirectional = std::bidirectional_iterator<IteratorT>;
33+
static constexpr bool random_access = std::random_access_iterator<IteratorT>;
34+
static constexpr bool contiguous = std::contiguous_iterator<IteratorT>;
3635

3736
static constexpr auto down_cast(const iterator_interface& other) {
3837
return dynamic_cast<const iterator_adaptor*>(std::addressof(other));

include/beman/any_view/detail/iterator_interface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace beman::any_view::detail {
1111

12-
template <class IterConceptT, class ElementT, class RefT, class RValueRefT, class DiffT>
12+
template <class ElementT, class RefT, class RValueRefT, class DiffT>
1313
class iterator_interface {
1414
using pointer = std::add_pointer_t<RefT>;
1515

0 commit comments

Comments
 (0)