You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
5.1 KiB
HTML

<html lang="en">
<head>
<title>C++ Extensions - Using the GNU Compiler Collection (GCC)</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using the GNU Compiler Collection (GCC)">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="prev" href="C-Extensions.html#C-Extensions" title="C Extensions">
<link rel="next" href="Objective_002dC.html#Objective_002dC" title="Objective-C">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988-2015 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Funding Free Software'', the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="C++-Extensions"></a>
<a name="C_002b_002b-Extensions"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Objective_002dC.html#Objective_002dC">Objective-C</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="C-Extensions.html#C-Extensions">C Extensions</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
<hr>
</div>
<h2 class="chapter">7 Extensions to the C++ Language</h2>
<p><a name="index-extensions_002c-C_002b_002b-language-4197"></a><a name="index-C_002b_002b-language-extensions-4198"></a>
The GNU compiler provides these extensions to the C++ language (and you
can also use most of the C language extensions in your C++ programs). If you
want to write code that checks whether these features are available, you can
test for the GNU compiler the same way as for C programs: check for a
predefined macro <code>__GNUC__</code>. You can also use <code>__GNUG__</code> to
test specifically for GNU C++ (see <a href="../cpp/Common-Predefined-Macros.html#Common-Predefined-Macros">Predefined Macros</a>).
<ul class="menu">
<li><a accesskey="1" href="C_002b_002b-Volatiles.html#C_002b_002b-Volatiles">C++ Volatiles</a>: What constitutes an access to a volatile object.
<li><a accesskey="2" href="Restricted-Pointers.html#Restricted-Pointers">Restricted Pointers</a>: C99 restricted pointers and references.
<li><a accesskey="3" href="Vague-Linkage.html#Vague-Linkage">Vague Linkage</a>: Where G++ puts inlines, vtables and such.
<li><a accesskey="4" href="C_002b_002b-Interface.html#C_002b_002b-Interface">C++ Interface</a>: You can use a single C++ header file for both
declarations and definitions.
<li><a accesskey="5" href="Template-Instantiation.html#Template-Instantiation">Template Instantiation</a>: Methods for ensuring that exactly one copy of
each needed template instantiation is emitted.
<li><a accesskey="6" href="Bound-member-functions.html#Bound-member-functions">Bound member functions</a>: You can extract a function pointer to the
method denoted by a &lsquo;<samp><span class="samp">-&gt;*</span></samp>&rsquo; or &lsquo;<samp><span class="samp">.*</span></samp>&rsquo; expression.
<li><a accesskey="7" href="C_002b_002b-Attributes.html#C_002b_002b-Attributes">C++ Attributes</a>: Variable, function, and type attributes for C++ only.
<li><a accesskey="8" href="Function-Multiversioning.html#Function-Multiversioning">Function Multiversioning</a>: Declaring multiple function versions.
<li><a accesskey="9" href="Namespace-Association.html#Namespace-Association">Namespace Association</a>: Strong using-directives for namespace association.
<li><a href="Type-Traits.html#Type-Traits">Type Traits</a>: Compiler support for type traits
<li><a href="Java-Exceptions.html#Java-Exceptions">Java Exceptions</a>: Tweaking exception handling to work with Java.
<li><a href="Deprecated-Features.html#Deprecated-Features">Deprecated Features</a>: Things will disappear from G++.
<li><a href="Backwards-Compatibility.html#Backwards-Compatibility">Backwards Compatibility</a>: Compatibilities with earlier definitions of C++.
</ul>
</body></html>