octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48726] caseless_str overloads compare and inv


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #48726] caseless_str overloads compare and inverts meaning
Date: Tue, 9 Aug 2016 02:28:59 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

URL:
  <http://savannah.gnu.org/bugs/?48726>

                 Summary: caseless_str overloads compare and inverts meaning
                 Project: GNU Octave
            Submitted by: carandraug
            Submitted on: Tue 09 Aug 2016 02:28:56 AM GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

liboctave has a caseless_str class which subclasses std::string.  It overloads
the compare method so that it compares both string in lowercase.

The issue is that the compare method returns a zero when strings are equal.
The overloaded methods returns true in that case, the opposite what one would
expect. This comes a bit of a surprise.

Also, the == and != operators have not been overloaded. I'm not sure they
should be, this sounds like trouble.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48726>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]