boost-preprocessor - Boost.Preprocessor 是独立的吗?

标签 boost-preprocessor

我正在考虑在某些项目中使用 Boost.Preprocessor,但我不想让整个 Boost 库成为依赖项。

我可以单独复制它并摆脱它吗?否则,它的依赖项是什么?

最佳答案

新答案

我刚刚让 bcp 工作:

./bcp --list 预处理器 --boost=/usr/local/include/boost_1_45_0/| grep -v 预处理器

no errors detected

没有 grep 我得到类似的东西:

boost/preprocessor.hpp
boost/preprocessor/arithmetic.hpp
boost/preprocessor/arithmetic/add.hpp
boost/preprocessor/arithmetic/dec.hpp
boost/preprocessor/arithmetic/detail/div_base.hpp
boost/preprocessor/arithmetic/div.hpp
boost/preprocessor/arithmetic/inc.hpp
boost/preprocessor/arithmetic/mod.hpp
boost/preprocessor/arithmetic/mul.hpp
boost/preprocessor/arithmetic/sub.hpp


原始答案

尝试使用 boost bcp 实用程序复制它

我做了一个快速的 grep -R "include"/usr/include/boost/preprocessor/* | grep -v preprocessor 并没有找到任何匹配项。我可以发誓需要配置。

编辑(我的 grep-ful 很弱 =/) grep -rh "include"/usr/include/boost/preprocessor/* | grep -v 预处理器 |排序 |uniq

# error BOOST_PP_ERROR: no indirect file to include
# include BOOST_PP_FILENAME_1
# include BOOST_PP_FILENAME_1
# include BOOST_PP_FILENAME_2
# include BOOST_PP_FILENAME_2
# include BOOST_PP_FILENAME_3
# include BOOST_PP_FILENAME_3
# include BOOST_PP_FILENAME_4
# include BOOST_PP_FILENAME_4
# include BOOST_PP_FILENAME_5
# include BOOST_PP_FILENAME_5
# include BOOST_PP_INDIRECT_SELF

grep -rhE "define\\s+BOOST_PP_FILENAME"/usr/include/boost/preprocessor/* |排序 |uniq

# define BOOST_PP_FILENAME_1 BOOST_PP_ARRAY_ELEM(2, BOOST_PP_ITERATION_PARAMS_1)
# define BOOST_PP_FILENAME_2 BOOST_PP_ARRAY_ELEM(2, BOOST_PP_ITERATION_PARAMS_2)
# define BOOST_PP_FILENAME_3 BOOST_PP_ARRAY_ELEM(2, BOOST_PP_ITERATION_PARAMS_3)
# define BOOST_PP_FILENAME_4 BOOST_PP_ARRAY_ELEM(2, BOOST_PP_ITERATION_PARAMS_4)
# define BOOST_PP_FILENAME_5 BOOST_PP_ARRAY_ELEM(2, BOOST_PP_ITERATION_PARAMS_5)

BOOST_PP_ITERATION_PARAMS_# 似乎没有在任何地方#defined。奇怪的是,它们在 ./detail/iter/forward#.hpp 中被#undef编辑,所以我可能遗漏了一些嵌套宏或其他...

关于boost-preprocessor - Boost.Preprocessor 是独立的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4797616/

相关文章:

boost-preprocessor - 升压-pp : how to determine if a macro parameter is a tuple

c-preprocessor - C99 预处理器图灵完整吗?

c++ - 如何在 BOOST_PP_IF 中扩展包含逗号的宏

c++ - 跟踪宏扩展

c++ - boost 预处理器 : Sample not working

c++ - 如何获取类型的唯一序列 c++ : (A, B, A, B, C) =>(A, B, C)

c++ - 递归显式模板实例化以导出库的符号

c++ - BOOST_PP_AUTO_REC 做什么?

c++ - 使用 Boost PP 枚举到 std::string - 改进语法

c++ - 使用 Boost.Preprocessor 生成一组带标签和索引的类模板特化