Boost logo

Boost Users :

From: adryio55 (adryio55_at_[hidden])
Date: 2002-05-30 03:09:07


Hello,
it seems there's an error in reg_expression::operator< in regex_compile.hpp file:

bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::operator<(const reg_expression<charT, traits, Allocator>& e)const
{
   //
   // we can't offer a diffinitive ordering, but we can be consistant:
   if(_flags != e.flags()) return _flags < e.flags();
   if(_expression_len != e._expression_len) return _expression_len < e._expression_len;

   //error
   //return std::memcmp(expression(), e.expression(), _expression_len);

   //right
   return std::memcmp(expression(), e.expression(), _expression_len) < 0;
}

The error makes (regular expressions with equal _flags and _expression_len) memcmp() result -1 and +1, to be coverted in the same true bool return value;
Thanks,

Adriano


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net