delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/04/04:49:34

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Static member functions in constructor
Date: Tue, 03 Jun 1997 19:06:19 -0700
Organization: Alcyone Systems
Lines: 23
Message-ID: <3394CD9B.7AB9AC1B@alcyone.com>
References: <AAuNrmY0pst AT mmf DOT univ DOT simbirsk DOT su>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

A.V. Kondratiev wrote:

> In case (1) the compiler reports that F1 is not defined. GCC doc
> tells that `g++' reports as undefined symbols any static data
> members that lack definitions. But I provided definition for F1!

The reason is because at the time of the declaration of A::A(ft), the
class A is incomplete; you can see this if you were to attempt declare the
member function as 

    A(ft f = &A::F1): pf(f) { }

which is the more complete form -- you'll get the error "incomplete type
`A' does not have member `F1'."  Unfortunately, you're forced to use your
second case or the equivalent.

-- 
       Erik Max Francis, &tSftDotIotE / email / max AT alcyone DOT com
                     Alcyone Systems /   web / http://www.alcyone.com/max/
San Jose, California, United States /  icbm / 37 20 07 N  121 53 38 W
                                   \
     "Covenants without the sword / are but words."
                                 / Camden

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019