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 33,109 of 33,346   
   Sergey Strukov to All   
   Re: Invalid C++ or bug in GCC 4.8   
   27 Jun 13 05:33:19   
   
   From: sshimnick@this.is.invalid   
      
   четверг, 27 июня 2013 г., 3:50:01 UTC+4 пользователь   
   marcel...@googlemail.com написал:   
   > Below is a completely stripped down version of the code. Is this illegal   
   > C++ code, or is this a bug in GCC 4.8?   
   >   
   > template  class ObjectFactory;   
   >   
   > template   
   > class ObjectFactory { };   
   >   
   > struct Abstract { virtual ~Abstract() = 0; };   
   >   
   > struct Concrete : Abstract { };   
   >   
   > typedef ObjectFactory< Abstract(), int> MyFactory;   
   >    
   >   
   > When compiling with GCC 4.8 I get the following error:   
   >   
   > Eabstract-class-type.cc:10:33: error: ‘type name’ declared as   
   > function returning an abstract class type   
   >   
   >  typedef ObjectFactory< Abstract(), int> MyFactory;   
      
   You cannot create an object of an abstract class type, so there cannot   
   be a function with such return type. The compiler error message is   
   completely reasonable here.   
      
      
   --   
         [ 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