| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* main.cpp :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2026/01/09 14:15:06 by bchanot #+# #+# */
- /* Updated: 2026/01/09 18:43:02 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "iter.hpp"
- class Test {
- public:
- Test(void) : _value(42) {return;};
- int getValue(void) const {return this->_value;};
- private:
- int _value;
- };
- std::ostream & operator<<( std::ostream & o, Test const & i ) {
- o << i.getValue();
- return o;
- }
- int main( void ) {
- int arr1[] = {1, 2, 3};
- int const arr2[] = {4, 5, 6};
- int arr3[] = {1, 2, 3, 4, 5};
- Test tab[5];
-
- iter(arr3, 5, printConst);
- iter(tab, 5, printConst);
- iter(arr1, 3, addTen);
- std::cout << arr1[0] << "; " << arr1[1] << "; " << arr1[2] << std::endl;
- iter(arr1, 3, printConst);
- iter(arr2, 3, printConst);
- iter(arr2, 3, print);
- }
|