mirror of
https://github.com/Ladebeze66/cpp-partie-2.git
synced 2025-12-16 22:17:53 +01:00
37 lines
1.3 KiB
C++
37 lines
1.3 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* iter.hpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/03/02 19:21:08 by fgras-ca #+# #+# */
|
|
/* Updated: 2024/03/02 19:56:14 by fgras-ca ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef ITER_HPP
|
|
#define ITER_HPP
|
|
|
|
#include <iostream>
|
|
|
|
#define RESET "\033[0m"
|
|
#define BLACK "\033[30m"
|
|
#define RED "\033[31m"
|
|
#define GREEN "\033[32m"
|
|
#define YELLOW "\033[33m"
|
|
#define BLUE "\033[34m"
|
|
#define MAGENTA "\033[35m"
|
|
#define CYAN "\033[36m"
|
|
#define WHITE "\033[37m"
|
|
|
|
template<typename T>
|
|
void iter(T* array, size_t length, void (*func)(T& element))
|
|
{
|
|
for (size_t i = 0; i < length; ++i)
|
|
{
|
|
func(array[i]);
|
|
}
|
|
}
|
|
|
|
#endif |