mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-30 10:04:24 +01:00
[iter] Rename random_access() to constexpr is_random_access()
This commit is contained in:
1 parent
2790aad28c
commit
fb053b6333
2 files changed
+4
-2
No files matched your search
+2
-2
@@ -83,7 +83,7 @@ struct hb_iter_t
|
||||
void forward (unsigned n) { thiz()->__forward__ (n); }
|
||||
void prev () { thiz()->__prev__ (); }
|
||||
void rewind (unsigned n) { thiz()->__rewind__ (n); }
|
||||
bool random_access () const { return thiz()->__random_access__ (); }
|
||||
constexpr bool is_random_access () const { return thiz()->__random_access__ (); }
|
||||
|
||||
protected:
|
||||
hb_iter_t () {}
|
||||
@@ -130,7 +130,7 @@ struct hb_iter_mixin_t
|
||||
void __rewind__ (unsigned n) { while (n--) thiz()->prev (); }
|
||||
|
||||
/* Random access: Return true if item_at(), len(), forward() are fast. */
|
||||
bool __random_access__ () const { return false; }
|
||||
constexpr bool __random_access__ () const { return false; }
|
||||
|
||||
protected:
|
||||
hb_iter_mixin_t () {}
|
||||
|
||||
@@ -73,6 +73,8 @@ test_iterator (Iterator it)
|
||||
it = it + 10;
|
||||
|
||||
assert (*it == it[0]);
|
||||
|
||||
if (it.is_random_access ()) {}
|
||||
}
|
||||
|
||||
template <typename Iterable> static void
|
||||
|
||||
Reference in new issue
Block a user