Skip to content

Commit 2286b2c

Browse files
committed
Removed all ForEach function from Array classes
1 parent 19a92f3 commit 2286b2c

File tree

6 files changed

+0
-874
lines changed

6 files changed

+0
-874
lines changed

engine/utils/collections/ArrayUtils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include <initializer_list>
1919
#include <utility>
2020

21-
#define LAMBDA(...) [&](__VA_ARGS__)
22-
2321
namespace Siege
2422
{
2523
class ArrayUtils

engine/utils/collections/HeapArray.h

Lines changed: 0 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -385,146 +385,6 @@ class MHArray
385385
return {this};
386386
}
387387

388-
/**
389-
* Iterates over the array and runs the provided function for each element-index pair. This
390-
* iterator works over every single element - not just those that were assigned to
391-
* @tparam F the function type
392-
* @param func the function to run over every element
393-
*/
394-
template<typename F,
395-
typename = typename std::enable_if<
396-
std::is_function<typename std::remove_reference<F>::type>::value>>
397-
inline void ForEachI(F&& func)
398-
{
399-
size_t i = 0;
400-
for (auto it = CreateFIterator(); it; ++it)
401-
{
402-
func(*it, i++);
403-
}
404-
}
405-
406-
/**
407-
* Iterates over the array and runs the provided function for each element. This
408-
* iterator works over every single element - not just those that were assigned to
409-
* @tparam F the function type
410-
* @param func the function to run over every element
411-
*/
412-
template<typename F,
413-
typename = typename std::enable_if<
414-
std::is_function<typename std::remove_reference<F>::type>::value>>
415-
inline void ForEach(F&& func)
416-
{
417-
for (auto it = CreateFIterator(); it; ++it)
418-
{
419-
func(*it);
420-
}
421-
}
422-
423-
/**
424-
* Iterates over the array and runs the provided function for each element-index pair. This
425-
* iterator works over every assigned element in the array
426-
* @tparam F the function type
427-
* @param func the function to run over every element
428-
*/
429-
template<typename F,
430-
typename = typename std::enable_if<
431-
std::is_function<typename std::remove_reference<F>::type>::value>>
432-
inline void MForEachI(F&& func)
433-
{
434-
size_t i = 0;
435-
for (auto it = CreateIterator(); it; ++it)
436-
{
437-
func(*it, i++);
438-
}
439-
}
440-
441-
/**
442-
* Iterates over the array and runs the provided function for each element. This
443-
* iterator works over every assigned element in the array
444-
* @tparam F the function type
445-
* @param func the function to run over every element
446-
*/
447-
template<typename F,
448-
typename = typename std::enable_if<
449-
std::is_function<typename std::remove_reference<F>::type>::value>>
450-
inline void MForEach(F&& func)
451-
{
452-
for (auto it = CreateIterator(); it; ++it)
453-
{
454-
func(*it);
455-
}
456-
}
457-
458-
/**
459-
* Iterates over the array and runs the provided function for each element-index pair. This
460-
* iterator works over every single element - not just those that were assigned to
461-
* @tparam F the function type
462-
* @param func the function to run over every element
463-
*/
464-
template<typename F,
465-
typename = typename std::enable_if<
466-
std::is_function<typename std::remove_reference<F>::type>::value>>
467-
inline void ForEachI(F&& func) const
468-
{
469-
size_t i = 0;
470-
for (auto it = CreateFIterator(); it; ++it)
471-
{
472-
func(*it, i++);
473-
}
474-
}
475-
476-
/**
477-
* Iterates over the array and runs the provided function for each element. This
478-
* iterator works over every single element - not just those that were assigned to
479-
* @tparam F the function type
480-
* @param func the function to run over every element
481-
*/
482-
template<typename F,
483-
typename = typename std::enable_if<
484-
std::is_function<typename std::remove_reference<F>::type>::value>>
485-
inline void ForEach(F&& func) const
486-
{
487-
for (auto it = CreateFIterator(); it; ++it)
488-
{
489-
func(*it);
490-
}
491-
}
492-
493-
/**
494-
* Iterates over the array and runs the provided function for each element-index pair. This
495-
* iterator works over every assigned element in the array
496-
* @tparam F the function type
497-
* @param func the function to run over every element
498-
*/
499-
template<typename F,
500-
typename = typename std::enable_if<
501-
std::is_function<typename std::remove_reference<F>::type>::value>>
502-
inline void MForEachI(F&& func) const
503-
{
504-
size_t i = 0;
505-
for (auto it = CreateIterator(); it; ++it)
506-
{
507-
func(*it, i++);
508-
}
509-
}
510-
511-
/**
512-
* Iterates over the array and runs the provided function for each element. This
513-
* iterator works over every assigned element in the array
514-
* @tparam F the function type
515-
* @param func the function to run over every element
516-
*/
517-
template<typename F,
518-
typename = typename std::enable_if<
519-
std::is_function<typename std::remove_reference<F>::type>::value>>
520-
inline void MForEach(F&& func) const
521-
{
522-
for (auto it = CreateIterator(); it; ++it)
523-
{
524-
func(*it);
525-
}
526-
}
527-
528388
/**
529389
* Returns the element in the MSArray
530390
* @return the last element in the array

engine/utils/collections/StackArray.h

Lines changed: 0 additions & 182 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
#include "BitSet.h"
1515
#include "Iterators.h"
1616

17-
#define MSA(type, count) Siege::MSArray<type, count>
18-
#define MSA_IT(type, count, name) LAMBDA(MSA(type, count) & name)
19-
#define MSA_IT_I(type, count, name, idxName) LAMBDA(MSA(type, count) & name, size_t idxName)
20-
2117
namespace Siege
2218
{
2319
/**
@@ -164,44 +160,6 @@ struct SArray
164160
return {this};
165161
}
166162

167-
template<typename F>
168-
inline void ForEachI(F&& func)
169-
{
170-
size_t i = 0;
171-
for (auto it = CreateIterator(); it; ++it)
172-
{
173-
func(*it, i++);
174-
}
175-
}
176-
177-
template<typename F>
178-
inline void ForEach(F&& func)
179-
{
180-
for (auto it = CreateIterator(); it; ++it)
181-
{
182-
func(*it);
183-
}
184-
}
185-
186-
template<typename F>
187-
inline void ForEachI(F&& func) const
188-
{
189-
size_t i = 0;
190-
for (auto it = CreateIterator(); it; ++it)
191-
{
192-
func(*it, i++);
193-
}
194-
}
195-
196-
template<typename F>
197-
inline void ForEach(F&& func) const
198-
{
199-
for (auto it = CreateIterator(); it; ++it)
200-
{
201-
func(*it);
202-
}
203-
}
204-
205163
T data[S];
206164
};
207165

@@ -501,146 +459,6 @@ class MSArray
501459
return {this};
502460
}
503461

504-
/**
505-
* Iterates over the array and runs the provided function for each element-index pair. This
506-
* iterator works over every single element - not just those that were assigned to
507-
* @tparam F the function type
508-
* @param func the function to run over every element
509-
*/
510-
template<typename F,
511-
typename = typename std::enable_if<
512-
std::is_function<typename std::remove_reference<F>::type>::value>>
513-
inline void ForEachI(F&& func)
514-
{
515-
size_t i = 0;
516-
for (auto it = CreateFIterator(); it; ++it)
517-
{
518-
func(*it, i++);
519-
}
520-
}
521-
522-
/**
523-
* Iterates over the array and runs the provided function for each element. This
524-
* iterator works over every single element - not just those that were assigned to
525-
* @tparam F the function type
526-
* @param func the function to run over every element
527-
*/
528-
template<typename F,
529-
typename = typename std::enable_if<
530-
std::is_function<typename std::remove_reference<F>::type>::value>>
531-
inline void ForEach(F&& func)
532-
{
533-
for (auto it = CreateFIterator(); it; ++it)
534-
{
535-
func(*it);
536-
}
537-
}
538-
539-
/**
540-
* Iterates over the array and runs the provided function for each element-index pair. This
541-
* iterator works over every assigned element in the array
542-
* @tparam F the function type
543-
* @param func the function to run over every element
544-
*/
545-
template<typename F,
546-
typename = typename std::enable_if<
547-
std::is_function<typename std::remove_reference<F>::type>::value>>
548-
inline void MForEachI(F&& func)
549-
{
550-
size_t i = 0;
551-
for (auto it = CreateIterator(); it; ++it)
552-
{
553-
func(*it, i++);
554-
}
555-
}
556-
557-
/**
558-
* Iterates over the array and runs the provided function for each element. This
559-
* iterator works over every assigned element in the array
560-
* @tparam F the function type
561-
* @param func the function to run over every element
562-
*/
563-
template<typename F,
564-
typename = typename std::enable_if<
565-
std::is_function<typename std::remove_reference<F>::type>::value>>
566-
inline void MForEach(F&& func)
567-
{
568-
for (auto it = CreateIterator(); it; ++it)
569-
{
570-
func(*it);
571-
}
572-
}
573-
574-
/**
575-
* Iterates over the array and runs the provided function for each element-index pair. This
576-
* iterator works over every single element - not just those that were assigned to
577-
* @tparam F the function type
578-
* @param func the function to run over every element
579-
*/
580-
template<typename F,
581-
typename = typename std::enable_if<
582-
std::is_function<typename std::remove_reference<F>::type>::value>>
583-
inline void ForEachI(F&& func) const
584-
{
585-
size_t i = 0;
586-
for (auto it = CreateFIterator(); it; ++it)
587-
{
588-
func(*it, i++);
589-
}
590-
}
591-
592-
/**
593-
* Iterates over the array and runs the provided function for each element. This
594-
* iterator works over every single element - not just those that were assigned to
595-
* @tparam F the function type
596-
* @param func the function to run over every element
597-
*/
598-
template<typename F,
599-
typename = typename std::enable_if<
600-
std::is_function<typename std::remove_reference<F>::type>::value>>
601-
inline void ForEach(F&& func) const
602-
{
603-
for (auto it = CreateFIterator(); it; ++it)
604-
{
605-
func(*it);
606-
}
607-
}
608-
609-
/**
610-
* Iterates over the array and runs the provided function for each element-index pair. This
611-
* iterator works over every assigned element in the array
612-
* @tparam F the function type
613-
* @param func the function to run over every element
614-
*/
615-
template<typename F,
616-
typename = typename std::enable_if<
617-
std::is_function<typename std::remove_reference<F>::type>::value>>
618-
inline void MForEachI(F&& func) const
619-
{
620-
size_t i = 0;
621-
for (auto it = CreateIterator(); it; ++it)
622-
{
623-
func(*it, i++);
624-
}
625-
}
626-
627-
/**
628-
* Iterates over the array and runs the provided function for each element. This
629-
* iterator works over every assigned element in the array
630-
* @tparam F the function type
631-
* @param func the function to run over every element
632-
*/
633-
template<typename F,
634-
typename = typename std::enable_if<
635-
std::is_function<typename std::remove_reference<F>::type>::value>>
636-
inline void MForEach(F&& func) const
637-
{
638-
for (auto it = CreateIterator(); it; ++it)
639-
{
640-
func(*it);
641-
}
642-
}
643-
644462
/**
645463
* Returns the element in the MSArray
646464
* @return the last element in the array

0 commit comments

Comments
 (0)