Parcourir la source

Remove inplace_t entirely

Sam Jaffe il y a 5 ans
Parent
commit
48258b5adb

+ 0 - 4
include/iterator/iterator_fwd.hpp

@@ -10,10 +10,6 @@
 #include <cstdlib>
 
 namespace iterator {
-  struct {
-  } in_place;
-  using in_place_t = decltype(in_place);
-
   template <typename Iterator> class end_aware_iterator;
   template <typename MetaIterator> class joining_iterator;
   template <typename Iterator> class recursive_iterator;

+ 0 - 19
include/iterator/recursive_iterator.hpp

@@ -144,13 +144,6 @@ namespace iterator { namespace detail {
     recursive_iterator_layer(recursive_iterator_layer<OIter, Rec> const & other)
         : layer(static_cast<recursive_iterator_base<OIter> const &>(other)),
           super(static_cast<Rec const &>(other)) {}
-    //    template <typename OIter, typename... Iterators>
-    //    recursive_iterator_layer(in_place_t, OIter && it, Iterators &&...
-    //    iter)
-    //        : layer(std::forward<OIter>(it)),
-    //          super(in_place, std::forward<Iterators>(iter)...) {
-    //      update();
-    //    }
 
     reference operator*() const { return super::get(); }
 
@@ -250,12 +243,6 @@ namespace iterator { namespace detail {
     flatten_iterator_layer(flatten_iterator_layer<OIter, Rec> const & other)
         : layer(static_cast<recursive_iterator_base<OIter> const &>(other)),
           super(static_cast<Rec const &>(other)) {}
-    //    template <typename OIter, typename... Iterators>
-    //    flatten_iterator_layer(in_place_t, OIter && it, Iterators &&... iter)
-    //        : layer(std::forward<OIter>(it)),
-    //          super(in_place, std::forward<Iterators>(iter)...) {
-    //      update();
-    //    }
 
     /**
      * @brief Concatenate the key in this layer, with the dereferenced data from
@@ -336,9 +323,6 @@ namespace iterator {
   public:
     using super::super;
     recursive_iterator() = default;
-    //    template <typename... Iterators>
-    //    recursive_iterator(in_place_t, Iterators &&... iter)
-    //        : super(in_place, std::forward<Iterators>(iter)...) {}
 
     recursive_iterator & operator++() {
       (void)super::next();
@@ -383,9 +367,6 @@ namespace iterator {
   public:
     using super::super;
     recursive_iterator_n() = default;
-    //    template <typename... Iterators>
-    //    recursive_iterator_n(in_place_t, Iterators &&... iter)
-    //        : super(in_place, std::forward<Iterators>(iter)...) {}
 
     recursive_iterator_n & operator++() {
       (void)super::next();

+ 0 - 18
include/iterator/recursive_iterator_meta.hpp

@@ -26,9 +26,6 @@ namespace iterator { namespace detail {
   public:
     using super::super;
     recursive_iterator_impl() = default;
-    //    template <typename OIter>
-    //    recursive_iterator_impl(in_place_t, OIter && iter)
-    //        : super(std::forward<OIter>(iter)) {}
 
   protected:
     void next() { super::operator++(); }
@@ -63,9 +60,6 @@ namespace iterator { namespace detail {
     }
     using super::super;
     recursive_iterator_impl() = default;
-    //    template <typename... Iterators>
-    //    recursive_iterator_impl(in_place_t, Iterators &&... iter)
-    //        : super(in_place, std::forward<Iterators>(iter)...) {}
   };
 
   /**
@@ -87,9 +81,6 @@ namespace iterator { namespace detail {
   public:
     using super::super;
     recursive_iterator_impl() = default;
-    //    template <typename... Iterators>
-    //    recursive_iterator_impl(in_place_t, Iterators &&... iter)
-    //        : super(in_place, std::forward<Iterators>(iter)...) {}
   };
 
   /**
@@ -113,9 +104,6 @@ namespace iterator { namespace detail {
   public:
     using super::super;
     bounded_recursive_iterator_impl() = default;
-    //    template <typename OIter>
-    //    bounded_recursive_iterator_impl(in_place_t, OIter && iter)
-    //        : super(std::forward<OIter>(iter)) {}
 
   protected:
     void next() { super::operator++(); }
@@ -154,9 +142,6 @@ namespace iterator { namespace detail {
     }
     using super::super;
     bounded_recursive_iterator_impl() = default;
-    //    template <typename... Iterators>
-    //    bounded_recursive_iterator_impl(in_place_t, Iterators &&... iter)
-    //        : super(in_place, std::forward<Iterators>(iter)...) {}
   };
 
   /**
@@ -182,9 +167,6 @@ namespace iterator { namespace detail {
   public:
     using super::super;
     bounded_recursive_iterator_impl() = default;
-    //    template <typename... Iterators>
-    //    bounded_recursive_iterator_impl(in_place_t, Iterators &&... iter)
-    //        : super(in_place, std::forward<Iterators>(iter)...) {}
   };
 }}
 

+ 0 - 24
test/recursive_iterator_accessors_test.cxx

@@ -141,27 +141,3 @@ TEST(BoundedRecursiveIteratorTest, CanFetchInnerCollections) {
   auto rit = make_recursive_iterator<2>(obj);
   EXPECT_THAT(*rit, obj[0][0]);
 }
-
-// TEST(RecursiveIteratorTest, CanConstructInPlaceFromIterators) {
-//  std::map<int, std::vector<std::map<int, int>>> const obj{
-//      {1, {{{1, 1}}, {{2, 2}}}}, {2, {{{3, 3}, {4, 4}}}}};
-//  auto const it = make_end_aware_iterator(obj.begin(), obj.end());
-//  auto const it_1 = ++make_end_aware_iterator(it->second);
-//  auto const it_2 = make_end_aware_iterator(*it_1);
-//  // Note that this carries the weakness of non bounds-checking that our
-//  // iterators are all sitting on the same hierarchy...
-//  EXPECT_NO_THROW(make_recursive_iterator(it, it_1, it_2));
-//}
-//
-// TEST(RecursiveIteratorTest, InternalIteratorsFromStdGetMatchCtorArgs) {
-//  std::map<int, std::vector<std::map<int, int>>> const obj{
-//      {1, {{{1, 1}}, {{2, 2}}}}, {2, {{{3, 3}, {4, 4}}}}};
-//  auto const it = make_end_aware_iterator(obj.begin(), obj.end());
-//  auto const it_1 = ++make_end_aware_iterator(it->second);
-//  auto const it_2 = make_end_aware_iterator(*it_1);
-//  iterator::recursive_iterator<decltype(obj.cbegin())> rit{iterator::in_place,
-//                                                           it, it_1, it_2};
-//  EXPECT_THAT(std::get<0>(rit), it);
-//  EXPECT_THAT(std::get<1>(rit), it_1);
-//  EXPECT_THAT(std::get<2>(rit), it_2);
-//}