vector_pro::print¶
Print the vector_pro¶
Print the vector_pro.
Please note that you must ensure your
value_typeimplements the<<stream insertion operator.Otherwise, you should pass a function
void(value_type&)as a param to tell us how to print thevalue_type
Parameters¶
print
A function can be call to print thevalue_type.
Return value¶
none
Example¶
C++
// vector_pro::print
#include <iostream>
#include "vector_pro.h"
/**
* Output:
* myvector contains: [ 32, 72, 55, 46, 32, 12, 61, 84, 39, 97 ]
*/
int main ()
{
vector_pro<int> myvector = { 32, 72, 55, 46, 32, 12, 61, 84, 39, 97 };
// print
std::cout << "myvector contains: ";
myvector.print();
std::cout << std::endl;
return 0;
}
Complexity¶
Linear in size.