소스 검색

fix: better SFINAE
chore: re-arrange files

Sam Jaffe 2 년 전
부모
커밋
deb094713e
4개의 변경된 파일16개의 추가작업 그리고 17개의 파일을 삭제
  1. 1 1
      include/iterator/detail/macro.h
  2. 1 1
      include/iterator/indexed_iterator.h
  3. 4 4
      include/iterator/proxy.h
  4. 10 11
      iterator.xcodeproj/project.pbxproj

+ 1 - 1
include/iterator/detail/macro.h

@@ -10,7 +10,7 @@
 #define _ITERATOR_MACRO_H
 
 #define SFINAE(trait, rval)                                                    \
-  template <bool _ = true> std::enable_if_t<trait<It> && _, rval>
+  template <bool _ = true> std::enable_if_t<trait && _, rval>
 
 #define VAL(X) std::declval<X>()
 #define DEREF_TYPE(X) decltype(*VAL(X))

+ 1 - 1
include/iterator/indexed_iterator.h

@@ -46,7 +46,7 @@ public:
   difference_type distance_to(indexed_iterator const & other) const {
     return other.base_ - base_;
   }
-  SFINAE(detail::has_sentinel_type_v, bool) at_end() const {
+  SFINAE(detail::has_sentinel_type_v<It>, bool) at_end() const {
     return base_ == typename It::sentinel_type();
   }
 

+ 4 - 4
include/iterator/proxy.h

@@ -23,7 +23,7 @@ public:
   decltype(auto) dereference() const { return *impl_; }
   void increment() { ++impl_; }
   bool equal_to(Self const & other) const { return impl_ == other.impl_; }
-  SFINAE(detail::has_sentinel_type_v, bool) at_end() const {
+  SFINAE(detail::has_sentinel_type_v<It>, bool) at_end() const {
     return impl() == typename It::sentinel_type();
   }
 
@@ -45,7 +45,7 @@ public:
   decltype(auto) dereference() const { return *impl_; }
   void increment() { ++impl_; }
   bool equal_to(Self const & other) const { return impl_ == other.impl_; }
-  SFINAE(detail::has_sentinel_type_v, bool) at_end() const {
+  SFINAE(detail::has_sentinel_type_v<It>, bool) at_end() const {
     return impl() == typename It::sentinel_type();
   }
 
@@ -68,7 +68,7 @@ public:
   void increment() { ++impl_; }
   void decrement() { --impl_; }
   bool equal_to(Self const & other) const { return impl_ == other.impl_; }
-  SFINAE(detail::has_sentinel_type_v, bool) at_end() const {
+  SFINAE(detail::has_sentinel_type_v<It>, bool) at_end() const {
     return impl() == typename It::sentinel_type();
   }
 
@@ -98,7 +98,7 @@ public:
   difference_type distance_to(Self const & other) const {
     return other.impl_ - impl_;
   }
-  SFINAE(detail::has_sentinel_type_v, bool) at_end() const {
+  SFINAE(detail::has_sentinel_type_v<It>, bool) at_end() const {
     return impl() == typename It::sentinel_type();
   }
 

+ 10 - 11
iterator.xcodeproj/project.pbxproj

@@ -154,8 +154,8 @@
 				CDCB3BD524E1D5320029B771 /* recursive_iterator_map_test.cxx */,
 				CDCB3BCF24E1D5320029B771 /* recursive_iterator_vector_test.cxx */,
 				CDCB3BFB24E327CF0029B771 /* recursive_iterator_single_level_test.cxx */,
-				CDCB3C0224E33A1E0029B771 /* zip_iterator_test.cxx */,
 				CDCB3BCE24E1D5320029B771 /* unkeyed_iterator_test.cxx */,
+				CDCB3C0224E33A1E0029B771 /* zip_iterator_test.cxx */,
 			);
 			path = test;
 			sourceTree = "<group>";
@@ -173,17 +173,16 @@
 			children = (
 				CDA2B6122858128C004D5353 /* forwards.h */,
 				CDA2B6132858128C004D5353 /* facade.h */,
-				CDA2B6142858128C004D5353 /* indexed_iterator.h */,
-				CDA2B6152858128C004D5353 /* unkeyed_iterator.h */,
-				CDA2B6162858128C004D5353 /* recursive_iterator.h */,
-				CDA2B6172858128C004D5353 /* detail */,
-				CDA2B61B2858128C004D5353 /* end_aware_iterator.h */,
-				CD6EBE2229D5C93A00F387C1 /* sentinel_iterator.h */,
 				CDA2B61C2858128C004D5353 /* proxy.h */,
 				CD5A8E7329D7910D008C2A4F /* sentinel.h */,
-				CDA2B61D2858128C004D5353 /* zip_iterator.h */,
+				CDA2B6172858128C004D5353 /* detail */,
+				CDA2B61B2858128C004D5353 /* end_aware_iterator.h */,
 				CDA2B61E2858128C004D5353 /* filter_iterator.h */,
+				CDA2B6142858128C004D5353 /* indexed_iterator.h */,
 				CDA2B61F2858128C004D5353 /* join_iterator.h */,
+				CDA2B6162858128C004D5353 /* recursive_iterator.h */,
+				CDA2B6152858128C004D5353 /* unkeyed_iterator.h */,
+				CDA2B61D2858128C004D5353 /* zip_iterator.h */,
 			);
 			path = iterator;
 			sourceTree = "<group>";
@@ -191,12 +190,12 @@
 		CDA2B6172858128C004D5353 /* detail */ = {
 			isa = PBXGroup;
 			children = (
+				CDA2B61A2858128C004D5353 /* arrow_proxy.h */,
+				CD5AEAE829D86DCD00A390A4 /* facade_traits.h */,
+				CD5AEB3129D8885400A390A4 /* macro.h */,
 				CDA2B6182858128C004D5353 /* recursive_traits.h */,
 				CDA2B6192858128C004D5353 /* traits.h */,
-				CD5AEB3129D8885400A390A4 /* macro.h */,
 				CD5AEB3229D8886200A390A4 /* undef.h */,
-				CD5AEAE829D86DCD00A390A4 /* facade_traits.h */,
-				CDA2B61A2858128C004D5353 /* arrow_proxy.h */,
 			);
 			path = detail;
 			sourceTree = "<group>";