C++ Boost: what's the cause of this warning?

后端 未结 6 1841
没有蜡笔的小新
没有蜡笔的小新 2020-12-03 04:16

I have a simple C++ with Boost like this:

#include 

int main()
{
  std::string latlonStr = \"hello,ergr()()rg(rg)\";
  boo         


        
6条回答
  •  醉话见心
    2020-12-03 04:51

    Alternatively, if you use C++11 and don't want to turn off warnings, you have the painful option of replacing

    boost::is_any_of(L"(,)")
    

    with the following lambda expression

    [](wchar_t &c) { for (auto candidate : { L'(', L',', L')' }) { if (c == candidate) return true; }; return false; }
    

    You can also possibly pack that into a macro

提交回复
热议问题