added print

This commit is contained in:
hugogogo
2022-06-15 21:23:19 +02:00
parent 32c413f741
commit 1cc5dabb7b
4 changed files with 52 additions and 75 deletions

View File

@@ -67,6 +67,7 @@ std::ostream & operator<<(std::ostream & o, mystruct const * rhs) {
// ****************************************
# define TITLE(s) std::cout << "\n" B_PURPLE #s RESET "\n\n";
# define VAL(n) val<T>(n)
# define PRINT(n) print_vector<T>(n)
// get a value
@@ -98,4 +99,17 @@ template <>
}
// get a value
// *********************************************
template <class T>
void print_vector(ft::vector<T> vec)
{
int i = 0;
for (typename ft::vector<T>::iterator it = vec.begin(); it != vec.end(); ++it, i++)
std::cout << "[" << i << "]" << *it << " ";
std::cout << "\nsize:" << vec.size() << " capacty:" << vec.capacity() << "\n";
}
#endif