makefile really improved on header dependencies
This commit is contained in:
33
tests/includes/tests_vector.hpp
Normal file
33
tests/includes/tests_vector.hpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef TESTS_VECTOR_HPP
|
||||
# define TESTS_VECTOR_HPP
|
||||
|
||||
#include "tests_utils.hpp"
|
||||
|
||||
|
||||
// toogle between test ft and stl
|
||||
// *************************
|
||||
#ifdef STL
|
||||
namespace ft = std;
|
||||
#else
|
||||
#include "vector.hpp"
|
||||
#include "reverse_iterator.hpp"
|
||||
#endif
|
||||
|
||||
|
||||
// templates print
|
||||
// *****************************************
|
||||
template <class T>
|
||||
void print(ft::vector<T>& vec, std::string name) {
|
||||
|
||||
int i = 0;
|
||||
typename ft::vector<T>::iterator it;
|
||||
typename ft::vector<T>::iterator it_end = vec.end();
|
||||
|
||||
std::cout << "\n" << name << ":(vector)\n";
|
||||
for (it = vec.begin(); it != it_end; ++it, i++)
|
||||
std::cout << "[" << i << "]" << *it << " ";
|
||||
std::cout << "\nsize:" << vec.size() << " capacty:" << vec.capacity() << "\n";
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user