Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/55.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Boost.preprocessor:Boost_PP_EQUAL不工作 P.Hello,我在C中有一个问题。我相信C++和C宏的行为完全一样,所以使用Boost。预处理器在C中是很好的,无论如何,我打算做一个小的完全预处理器库。我的问题是我不能用BOOST\u PP\u EQUAL编译一个小程序。以下是您可以构建的示例代码: #include <stdlib.h> #include <stdio.h> #include <boost/preprocessor.hpp> #define TUPLE (0,1,2) #define IS_NON_ZERO(NODE) BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(NODE),0) int main(void) { int x; x = IS_NON_ZERO(TUPLE); printf("result: %d\n",x); return EXIT_SUCCESS; }_C++_C_Boost_C Preprocessor_Boost Preprocessor - Fatal编程技术网

Boost.preprocessor:Boost_PP_EQUAL不工作 P.Hello,我在C中有一个问题。我相信C++和C宏的行为完全一样,所以使用Boost。预处理器在C中是很好的,无论如何,我打算做一个小的完全预处理器库。我的问题是我不能用BOOST\u PP\u EQUAL编译一个小程序。以下是您可以构建的示例代码: #include <stdlib.h> #include <stdio.h> #include <boost/preprocessor.hpp> #define TUPLE (0,1,2) #define IS_NON_ZERO(NODE) BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(NODE),0) int main(void) { int x; x = IS_NON_ZERO(TUPLE); printf("result: %d\n",x); return EXIT_SUCCESS; }

Boost.preprocessor:Boost_PP_EQUAL不工作 P.Hello,我在C中有一个问题。我相信C++和C宏的行为完全一样,所以使用Boost。预处理器在C中是很好的,无论如何,我打算做一个小的完全预处理器库。我的问题是我不能用BOOST\u PP\u EQUAL编译一个小程序。以下是您可以构建的示例代码: #include <stdlib.h> #include <stdio.h> #include <boost/preprocessor.hpp> #define TUPLE (0,1,2) #define IS_NON_ZERO(NODE) BOOST_PP_EQUAL(BOOST_PP_TUPLE_SIZE(NODE),0) int main(void) { int x; x = IS_NON_ZERO(TUPLE); printf("result: %d\n",x); return EXIT_SUCCESS; },c++,c,boost,c-preprocessor,boost-preprocessor,C++,C,Boost,C Preprocessor,Boost Preprocessor,我的代码有什么问题?提前谢谢 编辑:这是使用-E标志的非宏行 x = BOOST_PP_COMPL_BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_BOOST_PP_TUPLE_SIZE((0,1,2))(0, BOOST_PP_NOT_EQUAL_0); 怎么回事?将-DBOOST\u PP\u VARIADICS=1传递给编译器。将-DBOOST\u PP\u VARIADICS=1传递给编译器。+1。或者简单地在标题前添加#define BOOS

我的代码有什么问题?提前谢谢

编辑:这是使用
-E
标志的非宏行

 x = BOOST_PP_COMPL_BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_BOOST_PP_TUPLE_SIZE((0,1,2))(0, BOOST_PP_NOT_EQUAL_0);

怎么回事?

-DBOOST\u PP\u VARIADICS=1
传递给编译器。

-DBOOST\u PP\u VARIADICS=1
传递给编译器。

+1。或者简单地在标题前添加
#define BOOST\u PP\u VARIADICS
。我实际上切换到了定义
BOOST\u PP\u VARIADICS
+1的标准。或者简单地在标题前添加
#define BOOST\u PP\u VARIADICS
。实际上,我切换到了定义
BOOST\u PP\u VARIADICS
的标准。
 x = BOOST_PP_COMPL_BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_BOOST_PP_TUPLE_SIZE((0,1,2))(0, BOOST_PP_NOT_EQUAL_0);