c++ - boost vec(x,y,z)函数在哪里定义

标签 c++ boost

我在很多boost库中看到过这个函数vec(....)。它使用一些模板元魔术来构造一个 vector ,其中包含您放置在其中的值以进行类型推断。例如:

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

它对于测试以及传递 vector 值参数非常有用。但是我找不到它定义在哪个头文件中,并且谷歌搜索Boost vec完全没用,因为很明显你会得到关于 vector 类的一百万个结果。

有人知道它在哪里定义吗?

最佳答案

你是指boost::assign吗?图书馆?

这不是你提到的结构,但它是相似的。

关于c++ - boost vec(x,y,z)函数在哪里定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5104699/

相关文章:

c++ - 使用 boost::python 将 C++ 类实例传递给 python

c++ - 从 SVN 更新 Boost Wave

c++ - 转储箱/导出 : why does it differ between debug and release binaries?

c++ - 如何在 Visual Studio 2012 Visual C++ 中动态分配内存

c++ - 'managed_shared_memory' 应该分配多少内存? ( boost )

python - 将 Python 函数作为 Boost.Function 参数发送

c++ - 在 C++ 中检查数组位置是否为空的 CPU 高效方法

python - 如何在嵌入式 Python 脚本的错误消息中打印 PyObject 的类型?

c++ - 再次关于 enable_if_t 中的 C++ SFINAE

c++ - Boost/STL 在高性能计算方面是否慢?