file
Iterator.hThis module provides iterator Trait templates similar to the different categories of iterators in C++ for Cnx.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Functions
- DeclCnxIterators(char_ref)
- Declares all Cnx iterators for the builtin
char_ref
- DeclCnxIterators(u8_ref)
- Declares all Cnx iterators for the builtin
u8_ref
- DeclCnxIterators(u16_ref)
- Declares all Cnx iterators for the builtin
u16_ref
- DeclCnxIterators(u32_ref)
- Declares all Cnx iterators for the builtin
u32_ref
- DeclCnxIterators(u64_ref)
- Declares all Cnx iterators for the builtin
u64_ref
- DeclCnxIterators(usize_ref)
- Declares all Cnx iterators for the builtin
usize_ref
- DeclCnxIterators(i8_ref)
- Declares all Cnx iterators for the builtin
i8_ref
- DeclCnxIterators(i16_ref)
- Declares all Cnx iterators for the builtin
i16_ref
- DeclCnxIterators(i32_ref)
- Declares all Cnx iterators for the builtin
i32_ref
- DeclCnxIterators(i64_ref)
- Declares all Cnx iterators for the builtin
i64_ref
- DeclCnxIterators(isize_ref)
- Declares all Cnx iterators for the builtin
isize_ref
- DeclCnxIterators(f32_ref)
- Declares all Cnx iterators for the builtin
f32_ref
- DeclCnxIterators(f64_ref)
- Declares all Cnx iterators for the builtin
f64_ref
- DeclCnxIterators(cstring_ref)
- Declares all Cnx iterators for the builtin
cstring_ref
- DeclCnxIterators(const_cstring_ref)
- Declares all Cnx iterators for the builtin
const_cstring_ref
- DeclCnxIterators(const_char_ref)
- Declares all Cnx iterators for the builtin
const_char_ref
- DeclCnxIterators(const_u8_ref)
- Declares all Cnx iterators for the builtin
const_u8_ref
- DeclCnxIterators(const_u16_ref)
- Declares all Cnx iterators for the builtin
const_u16_ref
- DeclCnxIterators(const_u32_ref)
- Declares all Cnx iterators for the builtin
const_u32_ref
- DeclCnxIterators(const_u64_ref)
- Declares all Cnx iterators for the builtin
const_u64_ref
- DeclCnxIterators(const_usize_ref)
- Declares all Cnx iterators for the builtin
const_usize_ref
- DeclCnxIterators(const_i8_ref)
- Declares all Cnx iterators for the builtin
const_i8_ref
- DeclCnxIterators(const_i16_ref)
- Declares all Cnx iterators for the builtin
const_i16_ref
- DeclCnxIterators(const_i32_ref)
- Declares all Cnx iterators for the builtin
const_i32_ref
- DeclCnxIterators(const_i64_ref)
- Declares all Cnx iterators for the builtin
const_i64_ref
- DeclCnxIterators(const_isize_ref)
- Declares all Cnx iterators for the builtin
const_isize_ref
- DeclCnxIterators(const_f32_ref)
- Declares all Cnx iterators for the builtin
const_f32_ref
- DeclCnxIterators(const_f64_ref)
- Declares all Cnx iterators for the builtin
const_f64_ref
Defines
- #define CNX_ITERATOR
- Declarations and definitions related to Cnx iterators.
- #define CNX_ITERATOR_CONCRETE_TYPE_SIZE
- The maximum compatible size of a concrete type implementing a Cnx iterator trait.
- #define IntoIteratorSubType(CollectionType, IteratorType, ConversionName, IteratorSubType)
- Generates the function name for converting from one iterator category to its subcategory.
- #define CnxForwardIterator(T)
- Macro alias for
CnxForwardIterator
of typeT
- #define DeclCnxForwardIterator(T)
- Instantiates
CnxForwardIterator(T)
for the typeT
- #define DeclIntoCnxForwardIterator(CollectionType, T, IntoIterFuncName)
- Instantiates an
into_iter
function declaration. - #define ImplIntoCnxForwardIterator(CollectionType, T, IntoIterFuncName, CreateFunction, NextFunction, CurrentFunction, EqualsFunction)
- Instantiates an
into_iter
function definition. - #define CnxReverseIterator(T)
- Macro alias for
CnxReverseIterator
of typeT
- #define DeclCnxReverseIterator(T)
- Instantiates
CnxReverseIterator(T)
for the typeT
- #define DeclIntoCnxReverseIterator(CollectionType, T, IntoIterFuncName)
- Instantiates an
into_iter
function declaration. - #define ImplIntoCnxReverseIterator(CollectionType, T, IntoIterFuncName, CreateFunction, NextFunction, CurrentFunction, EqualsFunction)
- Instantiates an
into_iter
function definition. - #define CnxBidirectionalIterator(T)
- Macro alias for
CnxBidirectionalIterator
of typeT
- #define DeclCnxBidirectionalIterator(T)
- Instantiates
CnxBidirectionalIterator(T)
for the typeT
- #define DeclIntoCnxBidirectionalIterator(CollectionType, T, IntoIterFuncName, IteratorConversionName)
- Instantiates an
into_iter
function declaration and iterator conversion function declarations. - #define ImplIntoCnxBidirectionalIterator(CollectionType, T, IntoIterFuncName, IteratorConversionName, CreateFunction, NextFunction, PreviousFunction, CurrentFunction, EqualsFunction)
- Instantiates an
into_iter
function definition and iterator conversion function definitions. - #define CnxRandomAccessIterator(T)
- Macro alias for
CnxRandomAccessIterator
of typeT
- #define DeclCnxRandomAccessIterator(T)
- Instantiates
CnxRandomAccessIterator(T)
for the typeT
- #define DeclIntoCnxRandomAccessIterator(CollectionType, T, IntoIterFuncName, IteratorConversionName)
- Instantiates an
into_iter
function declaration and iterator conversion function declarations. - #define ImplIntoCnxRandomAccessIterator(CollectionType, T, IntoIterFuncName, IteratorConversionName, CreateFunction, NextFunction, PreviousFunction, AtFunction, CurrentFunction, EqualsFunction)
- Instantiates an
into_iter
function definition and iterator conversion function definitions. - #define cnx_iterator_next(iterator)
- Advances the iterator to the next element.
- #define cnx_iterator_previous(iterator)
- Decrements the iterator to the previous element.
- #define cnx_iterator_at(iterator, index)
- Returns a reference to the element at the given index in the iteration.
- #define cnx_iterator_current(iterator)
- Returns a reference to the element associated with the current position of the iterator.
- #define cnx_iterator_equals(lhs, rhs)
- Returns whether the given iterators are equal.
- #define cnx_iterator_into_forward_iterator(iterator)
- Converts the given
CnxBidirectionalIterator(T)
orCnxRandomAccessIterator(T)
into aCnxForwardIterator(T)
- #define cnx_iterator_into_reverse_iterator(iterator)
- Converts the given
CnxBidirectionalIterator(T)
orCnxRandomAccessIterator(T)
into aCnxReverseIterator(T)
- #define cnx_iterator_into_bidirectional_iterator(iterator)
- Converts the given
CnxRandomAccessIterator(T)
into aCnxBidirectionalIterator(T)
- #define foreach(element, collection)
- Loops over each element in the iteration of the given collection.
- #define foreach_ref(element, collection)
- Loops over each element in the iteration of the given collection.
- #define foreach_ref_mut(element, collection)
- Loops over each element in the iteration of the given collection.
- #define DeclCnxIterators(T)
- Instantiates each iterator category for the type T.