开发者

Where is the boost vec(x,y,z) function defined

开发者 https://www.devze.com 2023-02-13 17:26 出处:网络
I have seen this functionvec(....) in many boost libraries. It constructs a vector with the values you place in it using some template meta-magic to do the type inference. So for example:

I have seen this function vec(....) in many boost libraries. It constructs a vector with the values you place in it using some template meta-magic to do the type inference. So 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

Its really useful for testing as well as for passin开发者_StackOverflow社区g vectors valued parameters. But I can;t find which header file it is defined in, and Googling Boost vec is completely useless because obviously you get a million results about the vector class.

Does any know where it is defined?


Are you you are referring to the boost::assign library?

It not the construction you mention but it is similar.


Is Boost.Assign what you're looking for ?

0

精彩评论

暂无评论...
验证码 换一张
取 消