0

Assume there is QRegExp regex (wildcard) and QDirIterator dit. If they are identical, .i.e. they should match. Why does this

QString s = dirIterator.fileName();
if(ignore.exactMatch(s))
    continue;

match and the following not:

if(ignore.exactMatch(dirIterator.fileName()))
    continue;

I dont see anydifference, except that exact match accepts a const ref and in the latter case there is a rvalue. But this shouldnt matter, should it?

ManuelSchneid3r
  • 15,850
  • 12
  • 65
  • 103
  • I can't answer, as I don't know QRegExp, but from my experience with overloading operators, `const rhs` and ` rhs` are completely different, and that makes all the difference in the world. – CodeMouse92 Oct 01 '15 at 15:28
  • Nothing obvious stands out. What compiler are you using? Are you *sure* that this is the actual code that failing? For example the same filename does match in both cases but something else is behaving differently? – Mark B Oct 01 '15 at 16:05
  • I debugged it dozens of times. The second fails. gcc 5.2 – ManuelSchneid3r Oct 01 '15 at 17:05

0 Answers0