Game Development Reference
In-Depth Information
Chapter 1
Beginning C++
The C++ programming language was designed by Bjarne Stroustrup at Bell Labs, beginning in 1979.
The goal of the language was to provide useful features from other languages of the time, such as
Simula, with faster runtime performance. C was chosen as the basis for this new language due to its
execution speed, portability, and wide adoption.
The first major extension Stroustrup added to C was class support. Classes allowed a new
programming paradigm to be used with C: object-oriented programming (OOP). Stroustrup's new
language quickly became known as C with Classes , eventually changed to C++ in 1983.
C++ has been in continual development since its inception. New features were added regularly
throughout the 1980s and 1990s and many of these have become essential tools for game
developers. Examples of these features that are covered in this topic are virtual functions , templates,
and the Standard Template Library .
An ISO standard for C++ was first published in 1998. Standardizing a language gives compiler
writers a common set of features to implement if they wish to achieve C++ compatibility.
Standardization also benefits programmers writing code in C++ as it allows them to use a common
set of features that they can expect to behave in the same way when using multiple compilers
or multiple operating systems and computer architectures. There have been four C++ standards
released to date. The original standard is known as C++98. C++98 was added to with C++03, and
new experimental features were added to the language with C++TR1 (C++ Technical Review 1).
The current C++ standard is C++11.
This topic focuses on the most up-to-date version of the standard. However, this presents us with
some challenges, as not all compilers have been updated to support all of the latest features of
C++'. It can be taken for granted that when I refer to C++ in this topic I mean C++11; any topics that
require explicit reference to older C++ standards will be clear. The Microsoft' C++ compiler included
with its Visual Studio integrated development environment (IDE), for example, does not include
support for constant expressions or type aliasing. (Don't worry if you don't understand these terms;
they are new C++11 features and are covered in the section relating to templates.) Notes are added
to the text in sections where relevant features are not supported by one of the major compilers.
1
 
Search WWH ::




Custom Search