Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.c++.moderated    |    Moderated discussion of C++ superhackery    |    33,346 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 33,126 of 33,346    |
|    frank67x@googlemail.com to All    |
|    Re: a pimpl class for std::string just t    |
|    17 Jul 13 00:08:43    |
   
   { Reformatted; please limit your lines to 70 characters -mod }   
      
   Am Montag, 15. Juli 2013 08:34:08 UTC+2 schrieb James K. Lowden:   
   > On Sat, 13 Jul 2013 01:26:13 -0700 (PDT)   
   >   
   > frank67x@googlemail.com wrote:   
   > > i was looking for some std::string alike, which just handles   
   > > everything in lower case (actually as there is only one opposite -   
   > > upper case - it's about a case insensitive string class).   
   >   
   > Here's a koan for you: case sensitivity isn't a property of the   
   > string.   
   > For a proof, consider two strings   
   > scs, case-sensitive   
   > sci, case-insensitive   
   > and ask what is the meaning of   
   > scs == sci   
      
   Well, my starting point was about some upper case (scu) and lower case   
   (scl) string classes. I guess i was wrong saying "this actually is   
   like a case insensitive string class (sci)". Because sci doesn't tell,   
   what it actually is. This is different to either "all lc" or "all   
   uc". Whatever in sci represents for 'A'/'a' means "any of those ('A'   
   or 'a')". So you compare 'A' respectively 'a' with 'A or a' - both   
   match. I.e. "scs == sci" is a case-insensitive comparison in my   
   view. However some scu respectively scl excactly tells, what to   
   compare with some scs character (so case-sensitive comparison).   
      
   Thanks for pointing out! - i have to fix my comparison operators.   
      
   But my problem already started with constructing from std::string (or   
   char const * const). This already requires some class with   
   constructor.   
      
   > The "meaning" is defined by operator== and nothing else. The   
   > operator may look for hints in its operands; they might have a flag   
   > that says "treat as case-[in]sensitive", but the operator is free to   
   > honor or ignore the flag, and determines what to do if the flags are   
   > in contradiction.   
   >   
   > Contrast that with a bona fide string property, e.g. its encoding.   
   > It's impossible to know what characters are represented by the bytes   
   > in the string without knowing the encoding. Two strings of   
   > different encodings can be meaningfully compared only if both   
   > encodings are known; operator== can't return a meaningful result   
   > without that information.   
      
   { Quoted signature removed -mod }   
      
   Whatever represents case-insensitive can be compared.   
   The problem is to define a correct representation.   
      
   regards,   
   Frank   
      
      
   --   
    [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
    [ comp.lang.c++.moderated. First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca