Template Function otyca::write_vector
Function Documentation
-
template<typename T>
void otyca::write_vector(const std::vector<T> &vec, std::ofstream &outFile) Writes a vector to an output file.
This function serializes a vector of elements into a binary format and writes it to the specified output file stream. It first writes the size of the vector, followed by the vector’s data.
See also
std::ofstream::write
Note
The vector’s size is written first, followed by the raw binary data of the vector. The data is written using the
std::ofstream::write
method, and the vector’s data is interpreted as a stream of raw bytes.- Template Parameters:
T – The type of elements in the vector.
- Parameters:
vec – The vector to be written to the output file.
outFile – The output file stream where the vector will be written.