Boost.Preprocessor 是独立的吗?

发布于 2024-10-14 09:41:08 字数 96 浏览 2 评论 0原文

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

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

I'm thinking about using Boost.Preprocessor in some project, but I don't want to make the entire Boost library a dependency.

Can I just copy it alone and get away with this? Otherwise, what are its dependencies?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

堇年纸鸢 2024-10-21 09:41:08

新答案

我刚刚让 bcp 工作:

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

未检测到错误

没有 grep 我得到类似的信息:

boost/preprocessor.hpp
boost/预处理器/arithmetic.hpp
boost/预处理器/算术/add.hpp
boost/预处理器/算术/dec.hpp
boost/预处理器/算术/detail/div_base.hpp
boost/预处理器/算术/div.hpp
boost/预处理器/算术/inc.hpp
boost/预处理器/算术/mod.hpp
boost/预处理器/算术/mul.hpp
boost/预处理器/算术/sub.hpp


原始答案

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

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

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

# 错误 BOOST_PP_ERROR:没有要包含的间接文件
# 包括 BOOST_PP_FILENAME_1
# 包括 BOOST_PP_FILENAME_1
# 包括 BOOST_PP_FILENAME_2
# 包括 BOOST_PP_FILENAME_2
# 包括 BOOST_PP_FILENAME_3
# 包括 BOOST_PP_FILENAME_3
# 包括 BOOST_PP_FILENAME_4
# 包括 BOOST_PP_FILENAME_4
# 包括 BOOST_PP_FILENAME_5
# 包括 BOOST_PP_FILENAME_5
# 包括 BOOST_PP_INDIRECT_SELF

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

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

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

New Answer

I just got bcp working:

./bcp --list preprocessor --boost=/usr/local/include/boost_1_45_0/ | grep -v preprocessor

no errors detected

w/o the grep I get something like:

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


Original answer

Try using the boost bcp utility to copy it

I did a quick grep -R "include" /usr/include/boost/preprocessor/* | grep -v preprocessor and didn't come up with any matches. I could have sworn that config was needed.

Edit (my grep-ful is weak =/)
grep -rh "include" /usr/include/boost/preprocessor/* | grep -v preprocessor | sort |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/* | sort |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_# don't seem to be #defined anywhere. Strangely enough, they are #undefed in ./detail/iter/forward#.hpp so I'm probably missing some nested macro or other...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文