Project made from zero
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2026/03/21 15:53:06 by aortigos #+# #+# */
|
||||
/* Updated: 2026/03/21 16:58:31 by aortigos ### ########.fr */
|
||||
/* Created: 2026/03/23 14:19:16 by aortigos #+# #+# */
|
||||
/* Updated: 2026/03/23 14:25:35 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -15,19 +15,23 @@
|
||||
# define ITER_HPP
|
||||
|
||||
# include <iostream>
|
||||
# include <cctype>
|
||||
|
||||
template <typename PTR, typename F>
|
||||
void iter(PTR *address, size_t const lenght, F func)
|
||||
template <typename PTR, typename T>
|
||||
void iter(PTR *address, unsigned int const length, T func)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
i = 0;
|
||||
while (i < lenght)
|
||||
for (unsigned int i = 0; i < length; i++)
|
||||
{
|
||||
func(address[i]);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
template <typename PTR, typename T>
|
||||
void iter(PTR const *address, unsigned int const length, T func)
|
||||
{
|
||||
for (unsigned int i = 0; i < length; i++)
|
||||
{
|
||||
func(address[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user