2017-04-23 97 views
1

嘗試連接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 + "right"_s; 
} 

此失敗,錯誤error: no match for ‘operator+’ (operand types are ‘boost::hana::string<'l', 'e', 'f', 't', ',', ' '>’ and ‘boost::hana::string<'r', 'i', 'g', 'h', 't'>’) 上GCC 6.3.1。與花與Boost 1.62.0

作爲一個側面說明,與hana::plus更換運營商+失敗,錯誤hana::plus(x, y) requires 'x' to be a Monoid

+1

[作品在升壓1.63](https://wandbox.org/permlink/LDuI2ykh0b4HC5OC) – chris

+0

是的它是在1.63加入。 https://github.com/boostorg/hana/commit/7a3e0480d442c393ed7bcc1ca72a3e1821319ff0 –

+0

完美,謝謝。 –

回答