Template Function otyca::read_vector

Function Documentation

template<typename T>
void otyca::read_vector(std::vector<T> &vec, std::ifstream &inFile)

Reads a vector from an input file.

This function reads a serialized vector from a binary input file. It first reads the size of the vector, then reads the corresponding data and populates the vector.

See also

std::ifstream::read

Note

The size of the vector is read first, followed by the raw binary data of the vector. The data is read using the std::ifstream::read 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 populated with the data read from the input file.

  • inFile – The input file stream from which the vector data is read.