I have seen this vec (....) function in many boost libraries. It creates a vector with the values that you place in it, using the template metamaria to perform type inference. For example:
vec(1,2) returns vector<int> filled with 1,2
vec(1.1,2.2,3.3) returns vector<float> filled with 1.1,2.2,3.3
It is really useful for testing, as well as for evaluating the parameters of vectors. But I cannot find the header file in which it is defined, and Googling is Boost veccompletely useless, because obviously you get a million results about the vector class.
Does anyone know where this is defined?
source
share