Forward Declaration - Forward Reference

The term forward reference is sometimes used as a synonym of forward declaration. However, more often it is taken to refer to the actual use of an entity before any declaration; that is, the first reference to second in the code above is a forward reference. Thus, we may say that because forward declarations are mandatory in Pascal, forward references are prohibited.

An example of (valid) forward reference in C++:

class C { public: void mutator(int x) { myValue = x; } int accessor { return myValue; } private: int myValue; };

In this example, there are two references to myValue before it is declared. C++ generally prohibits forward references, but they are allowed in the special case of class members. Since the member function accessor cannot be compiled until the compiler knows the type of the member variable myValue, it is the compiler's responsibility to remember the definition of accessor until it sees myValue's declaration.

Permitting forward references can greatly increase the complexity and memory requirements of a compiler, and generally prevents the compiler from being implemented in one pass.

Read more about this topic:  Forward Declaration

Other articles related to "reference, references":

Barton Fink - Sources, Inspirations, and Allusions
... The literary reference not only demonstrates the character's knowledge of classic texts, but the poem's reference to the Pacific Ocean matches Mayhew's ... This is likely a reference to Marshall Swain and George Pappas, philosophers whose work focuses on themes explored in the movie, including the limitations of knowledge and nature of being ... Critics have suggested that the movie indirectly references the work of writers Dante Alighieri (through the use of Divine Comedy imagery) and Johann Wolfgang von Goethe (through the presence ...
GRS 80 - Geodesy
... The geometrical separation between it and the reference ellipsoid is called the geoidal undulation ... A reference ellipsoid, customarily chosen to be the same size (volume) as the geoid, is described by its semi-major axis (equatorial radius) a and flattening f ... The 1980 Geodetic Reference System (GRS 80) posited a 378. 137m semi-major axis and a 1/298.257 101 ... flattening ...
Encyclopedia Of Public Health
... The Encyclopedia of Public Health is a reference set of four volumes covering all aspects of public health for the lay reader ... the CHOICE 2002 award for Outstanding Academic Reference Title and has been listed in the Booklist/Reference Book Bulletin Editor's Choice of Outstanding Reference titles ...
Barton Fink - Themes - Religion
... alludes to "the story of Solomon's mammy", a reference to Bathsheba, who gave birth to Solomon after her lover David had her husband Uriah killed ... (which Audrey herself may have written), the reference foreshadows the love triangle which evolves among the three characters of Barton Fink ... Another Biblical reference comes when Barton flips to the front of the Bible in his desk drawer, and sees his own words transposed into the Book of Genesis ...
Reference Dose - Types
... Reference doses are chemical-specific, i.e ... the EPA determines a unique reference dose for every substance it evaluates ... Reference doses are specific to dietary exposure ...

Famous quotes containing the word reference:

    A sign, or representamen, is something which stands to somebody for something in some respect or capacity. It addresses somebody, that is, creates in the mind of that person an equivalent sign, or perhaps a more developed sign. That sign which it creates I call the interpretant of the first sign. The sign stands for something, its object. It stands for that object, not in all respects, but in reference to a sort of idea, which I have sometimes called the ground of the representamen.
    Charles Sanders Peirce (1839–1914)

    I think, for the rest of my life, I shall refrain from looking up things. It is the most ravenous time-snatcher I know. You pull one book from the shelf, which carries a hint or a reference that sends you posthaste to another book, and that to successive others. It is incredible, the number of books you hopefully open and disappointedly close, only to take down another with the same result.
    Carolyn Wells (1862–1942)