added print
This commit is contained in:
@@ -29,7 +29,6 @@ void add_to_list(std::string s, A_test* s1, A_test* s2, A_test* s3, A_test* s4)
|
||||
|
||||
// *********************************************
|
||||
// prototypes
|
||||
void test_simple();
|
||||
void tests_vector_constructor();
|
||||
void tests_vector_operator_assignation();
|
||||
void tests_vector_begin();
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user