Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/127.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
C++ 串联Boost Hana字符串_C++_Boost Hana - Fatal编程技术网

C++ 串联Boost Hana字符串

C++ 串联Boost Hana字符串,c++,boost-hana,C++,Boost Hana,尝试连接Boost Hana编译时字符串会在我的应用程序中导致编译器错误。是否有任何要激活的特定配置选项或需要包含的标题才能使其工作 以下是一个例子: #define BOOST_HANA_CONFIG_ENABLE_STRING_UDL #include "boost/hana.hpp" namespace hana = boost::hana; using namespace hana::literals; int main() { auto t = "left, "_s + "r

尝试连接Boost Hana编译时字符串会在我的应用程序中导致编译器错误。是否有任何要激活的特定配置选项或需要包含的标题才能使其工作

以下是一个例子:

#define BOOST_HANA_CONFIG_ENABLE_STRING_UDL
#include "boost/hana.hpp"

namespace hana = boost::hana;

using namespace hana::literals;

int main() {
  auto t = "left, "_s + "right"_s;
}
此操作失败,错误为:与“运算符+”不匹配(操作数类型为“boost::hana::string”和“boost::hana::string”) 在GCC 6.3.1中。使用Boost 1.62.0中的Hana


作为补充说明,将操作符
+
替换为
hana::plus
失败,出现错误
hana::plus(x,y)要求“x”是一个幺半群

,正如Jason Rice指出的,Boost 1.63中增加了对编译时字符串连接的支持

是的,它是在1.63中添加的。