d07 ex01 ok
This commit is contained in:
13
d07/ex01/headers/Decrement.hpp
Normal file
13
d07/ex01/headers/Decrement.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef DECREMENT_HPP
|
||||
# define DECREMENT_HPP
|
||||
|
||||
# include <iostream>
|
||||
# include <string>
|
||||
|
||||
template< typename T >
|
||||
void Decrement(T & e) {
|
||||
--e;;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
11
d07/ex01/headers/Iter.hpp
Normal file
11
d07/ex01/headers/Iter.hpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef ITER_HPP
|
||||
# define ITER_HPP
|
||||
|
||||
template< typename T, typename F >
|
||||
void Iter(T *arr, size_t len, F & f)
|
||||
{
|
||||
for (size_t i = 0; i < len; i++)
|
||||
f(arr[i]);
|
||||
}
|
||||
|
||||
#endif
|
||||
13
d07/ex01/headers/Print.hpp
Normal file
13
d07/ex01/headers/Print.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef PRINT_HPP
|
||||
# define PRINT_HPP
|
||||
|
||||
# include <iostream>
|
||||
# include <string>
|
||||
|
||||
template< typename T >
|
||||
void Print(T const & e) {
|
||||
std::cout << "[" << e << "]\n";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
14
d07/ex01/headers/ToUpper.hpp
Normal file
14
d07/ex01/headers/ToUpper.hpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#ifndef TOUPPER_HPP
|
||||
# define TOUPPER_HPP
|
||||
|
||||
# include <iostream>
|
||||
# include <string>
|
||||
# include <cctype>
|
||||
|
||||
template< typename T >
|
||||
void ToUpper(T & e) {
|
||||
e = toupper(e);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
25
d07/ex01/headers/colors.h
Normal file
25
d07/ex01/headers/colors.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef COLORS_H
|
||||
# define COLORS_H
|
||||
|
||||
# define GRAY "\e[0;30m"
|
||||
# define RED "\e[0;31m"
|
||||
# define GREEN "\e[0;32m"
|
||||
# define YELLOW "\e[0;33m"
|
||||
# define BLUE "\e[0;34m"
|
||||
# define PURPLE "\e[0;35m"
|
||||
# define CYAN "\e[0;36m"
|
||||
# define WHITE "\e[0;37m"
|
||||
|
||||
# define B_GRAY "\e[1;30m"
|
||||
# define B_RED "\e[1;31m"
|
||||
# define B_GREEN "\e[1;32m"
|
||||
# define B_YELLOW "\e[1;33m"
|
||||
# define B_BLUE "\e[1;34m"
|
||||
# define B_PURPLE "\e[1;35m"
|
||||
# define B_CYAN "\e[1;36m"
|
||||
# define B_WHITE "\e[1;37m"
|
||||
|
||||
# define RESET "\e[0m"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user