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,962 of 33,346   
   Krzysztof =?UTF-8?B?xbtlbGVjaG93c2t to All   
   What is the purpose of the explicit keyw   
   02 Mar 12 02:32:54   
   
   From: giecrilj@stegny.2a.pl   
      
      
      
   	What is the purpose of the explicit keyword?   
      
   	To tell the compiler that a certain constructor may not be used to 	   
   implicitly cast an expression to its class type.   
      
   	Foo a = 42;   
      
   	Compile-time error: can't convert 42 to an object of type Foo   
      
   What is implicit about that definition?  The type is explicitly given, and   
   the definition should be accepted IMHO.   
      
   Chris   
      
      
   --   
         [ 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