This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Possible messaging changes


Arthur Schwarz wrote:

> /*
>  * m3.cpp
> */
> 
> # include <istream>
> # include <istream>
> 
> using namespace std;
> 
> ifstream  x;
> ifstream  y();


> If 'std::ifstream' not found, why is 'std::ifstream y();' legal?


  Ooh, I know this one.  It's because it's not a definition of an ifstream
object constructed by a default constructor.  It's a forward declaration of a
function y() taking no args and returning an ifstream object by value.

    cheers,
      DaveK


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]