On 7/23/2014 3:47 PM, Greg Rubino wrote:
On Wed, Jul 23, 2014 at 4:07 PM, Greg Rubino wrote:
Hi all,
I'm trying to capture a float with xpressive and put it into a local map. As a simplified example, I tried just pushing the matched pattern to a float and the result is always a float containing '0'.
namespace xpr = boost::xpressive;
std::map
l_floatOperMap; xpr::sregex l_relation = xpr::as_xpr("<=") | ">=" | "<" | ">"); l_floatRestriction = !(xpr::s1 = l_relation) >> (xpr::s2 = (+xpr::_d >> '.' >> +xpr::_d)) [xpr::ref(l_floatOperMap)[xpr::as<float>(xpr::s2)] = xpr::asstd::string(xpr::s1)];
However, when I go to print the contents of l_floatOperMap, it contains only the tuple (0, ""). Is it something I'm doing wrong? It seems like this should work to me.
I neglected to mention that I am actually doing the very same thing with uint32_t and it works fine.
Works for me. This program:
#include <map>
#include <iostream>
#include