home bbs files messages ]

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 31,375 of 33,346   
   =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to All   
   Re: using reinterpret_cast to convert be   
   24 Jun 11 13:02:13   
   
   From: daniel.kruegler@googlemail.com   
      
   On 2011-06-24 00:11, Daniel Krügler wrote:   
   > I notice that the C1x standard (N1569) is pretty similar here, but adds   
   > somewhat more in regard to qualifiers:   
   >   
   > 6.2.7:   
   >   
   > "Two types have compatible type if their types are the same. Additional   
   > rules for determining whether two types are compatible are described in   
   > 6.7.2 for type specifiers, in 6.7.3 for type qualifiers,[..]"   
   >   
   > 6.7.3 p10:   
   >   
   > "For two qualified types to be compatible, both shall have the   
   > identically qualified version of a compatible type; the order of type   
   > qualifiers within a list of specifiers or qualifiers does not affect the   
   > specified type."   
   >   
   > The last part seems at least not to exclude the possibility that const   
   > int and int are compatible types. It might be very reasonable that C++   
   > follows this approach.   
      
   I have been told that I'm misinterpreting the C standard here, in fact   
   the C term of "compatible types" corresponds (more or less) to the C++   
   "same type" concept. I also misinterpreted 6.7.3 p10 to allow for making   
   int and const int compatible, because the absense of a qualifier is also   
   a difference.   
      
   Nevertheless it seems that C++ misses to synchronize the term   
   "layout-compatible types" with the "same representation and alignment   
   requirements" properly taking properly type qualification into account.   
      
   I apologize for any confusion && send greetings from Bremen,   
      
   Daniel Krügler   
      
      
   --   
         [ 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