In the example below, if I don't cast 4 as unsigned I get a warning about '<=' signed/unsigned mismatch in default.hpp(144) followed by many more warning I don't follow.
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <string>
namespace qi = boost::spirit::qi;
typedef std::wstring::const_iterator it_type;
int main()
{
using qi::_1;
using boost::spirit::_pass;
std::wstring testChar(L"450");
auto f = testChar.begin(), l = testChar.end();
unsigned pVal[2] = {0, 0};
qi::uint_parser<unsigned, 10, 1, 1> uint1_p;
bool retVal = qi::parse(f, l, uint1_p[_pass = _1 <= (unsigned)4] >> qi::uint_, pVal[0], pVal[1]);
return 0;
}
Is it just best to always cast in this case?
Building on Visual Studio 2015 with Boost 1.61.0