With the 'evt::print()' function you can display information easily.
The 'to_string' function let you convert ANY data container (like std::vector) to string.
· print:
print(const Type& value, const Args& ...args);
· Example:
print("This is a number:", 23123); // Output -> This is a number: 23123
· to_string for containers like std::vector
, std::array
, etc:
to_string(const container& cont);
· Example using both functions:
print("My vector:", to_string(vector)); // Possible output -> My vector: [1, 2, 3]
// or:
print("My vector:", vector);
· to_string for classic arrays:
to_string(const T * array, size_t size);
· Example:
print(to_string(array, 5));
· to_string for matrices:
to_string(const Type& matrix, size_t rows, size_t cols);
· Example:
print(to_string(matrix, rows, cols)); // An output -> [[1, 2], [3, 4], [5, 6]]
g++ -std=c++14 main.cpp -I . // Where "." is the folder containing "print.hpp"