Commit 30a20a1e by Phil Edwards

New concept checking implementation.

2001-04-02  Phil Edwards  <pme@sources.redhat.com>

	New concept checking implementation.
	* docs/html/19_diagnostics/howto.html:  Document.
	* docs/html/17_intro/concept_check.diff:  New file, for reference.
	* include/bits/boost_concept_check.h:  New file from Boost.
	* include/bits/c++config:  Update comments.

	* include/bits/concept_check.h:  New file.
	* include/bits/concept_checks.h:  Removed.
	* include/bits/container_concepts.h:  Removed.
	* include/bits/sequence_concepts.h:  Removed.
	* include/bits/stl_iterator_base.h:  Removed; split into...
	* include/bits/stl_iterator_base_funcs.h:  ...this new file...
	* include/bits/stl_iterator_base_types.h:  ...and this new file.

	* include/bits/sbuf_iter.h:  Update to use new implementation.
	* include/bits/std_iterator.h:  Likewise.
	* include/bits/std_memory.h:  Likewise.
	* include/bits/stl_algo.h:  Likewise.
	* include/bits/stl_algobase.h:  Likewise.
	* include/bits/stl_construct.h:  Likewise.
	* include/bits/stl_deque.h:  Likewise.
	* include/bits/stl_heap.h:  Likewise.
	* include/bits/stl_list.h:  Likewise.
	* include/bits/stl_map.h:  Likewise.
	* include/bits/stl_multimap.h:  Likewise.
	* include/bits/stl_multiset.h:  Likewise.
	* include/bits/stl_numeric.h:  Likewise.
	* include/bits/stl_queue.h:  Likewise.
	* include/bits/stl_set.h:  Likewise.
	* include/bits/stl_stack.h:  Likewise.
	* include/bits/stl_uninitialized.h:  Likewise.
	* include/bits/stl_vector.h:  Likewise.
	* include/ext/hash_map:  Likewise.
	* include/ext/hash_set:  Likewise.
	* include/ext/slist:  Likewise.
	* include/ext/stl_hashtable.h:  Likewise.

	* src/Makefile.am (base_headers):  Update list of headers.
	* Makefile.in:  Regenerated.
	* src/Makefile.in:  Regenerated.
	* libio/Makefile.in:  Regenerated.
	* libmath/Makefile.in:  Regenerated.
	* libsupc++/Makefile.in:  Regenerated.
	* testsuite/Makefile.in:  Regenerated.

	* docs/html/install.html:  Update contact information.
	* docs/html/17_intro/howto.html:  Ditto.
	* docs/html/18_support/howto.html:  Ditto.
	* docs/html/20_util/howto.html:  Ditto.
	* docs/html/21_strings/howto.html:  Ditto.
	* docs/html/22_locale/howto.html:  Ditto.
	* docs/html/23_containers/howto.html:  Ditto.
	* docs/html/24_iterators/howto.html:  Ditto.
	* docs/html/25_algorithms/howto.html:  Ditto.
	* docs/html/26_numerics/howto.html:  Ditto.
	* docs/html/27_io/howto.html:  Ditto.
	* docs/html/faq/index.html:  Ditto, plus info on new checking code.
	* docs/html/ext/howto.html:  Ditto, plus info on new checking code.
	* docs/html/faq/index.txt:  Regenerated.

From-SVN: r41031
parent 9f4a318c
2001-04-02 Phil Edwards <pme@sources.redhat.com>
New concept checking implementation.
* docs/html/19_diagnostics/howto.html: Document.
* docs/html/17_intro/concept_check.diff: New file, for reference.
* include/bits/boost_concept_check.h: New file from Boost.
* include/bits/c++config: Update comments.
* include/bits/concept_check.h: New file.
* include/bits/concept_checks.h: Removed.
* include/bits/container_concepts.h: Removed.
* include/bits/sequence_concepts.h: Removed.
* include/bits/stl_iterator_base.h: Removed; split into...
* include/bits/stl_iterator_base_funcs.h: ...this new file...
* include/bits/stl_iterator_base_types.h: ...and this new file.
* include/bits/sbuf_iter.h: Update to use new implementation.
* include/bits/std_iterator.h: Likewise.
* include/bits/std_memory.h: Likewise.
* include/bits/stl_algo.h: Likewise.
* include/bits/stl_algobase.h: Likewise.
* include/bits/stl_construct.h: Likewise.
* include/bits/stl_deque.h: Likewise.
* include/bits/stl_heap.h: Likewise.
* include/bits/stl_list.h: Likewise.
* include/bits/stl_map.h: Likewise.
* include/bits/stl_multimap.h: Likewise.
* include/bits/stl_multiset.h: Likewise.
* include/bits/stl_numeric.h: Likewise.
* include/bits/stl_queue.h: Likewise.
* include/bits/stl_set.h: Likewise.
* include/bits/stl_stack.h: Likewise.
* include/bits/stl_uninitialized.h: Likewise.
* include/bits/stl_vector.h: Likewise.
* include/ext/hash_map: Likewise.
* include/ext/hash_set: Likewise.
* include/ext/slist: Likewise.
* include/ext/stl_hashtable.h: Likewise.
* src/Makefile.am (base_headers): Update list of headers.
* Makefile.in: Regenerated.
* src/Makefile.in: Regenerated.
* libio/Makefile.in: Regenerated.
* libmath/Makefile.in: Regenerated.
* libsupc++/Makefile.in: Regenerated.
* testsuite/Makefile.in: Regenerated.
* docs/html/install.html: Update contact information.
* docs/html/17_intro/howto.html: Ditto.
* docs/html/18_support/howto.html: Ditto.
* docs/html/20_util/howto.html: Ditto.
* docs/html/21_strings/howto.html: Ditto.
* docs/html/22_locale/howto.html: Ditto.
* docs/html/23_containers/howto.html: Ditto.
* docs/html/24_iterators/howto.html: Ditto.
* docs/html/25_algorithms/howto.html: Ditto.
* docs/html/26_numerics/howto.html: Ditto.
* docs/html/27_io/howto.html: Ditto.
* docs/html/faq/index.html: Ditto, plus info on new checking code.
* docs/html/ext/howto.html: Ditto, plus info on new checking code.
* docs/html/faq/index.txt: Regenerated.
2001-04-02 Zack Weinberg <zackw@stanford.edu>
* testsuite/lib/libstdc++.exp (dg-test): Annotate result
......
......@@ -135,7 +135,48 @@ MULTICLEAN = true
# Work around what appears to be a GNU make bug handling MAKEFLAGS
# values defined in terms of make variables, as is the case for CC and
# friends when we are called from the top level Makefile.
AM_MAKEFLAGS = "AR_FLAGS=$(AR_FLAGS)" "CC_FOR_BUILD=$(CC_FOR_BUILD)" "CC_FOR_TARGET=$(CC_FOR_TARGET)" "CFLAGS=$(CFLAGS)" "CXXFLAGS=$(CXXFLAGS)" "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" "INSTALL=$(INSTALL)" "INSTALL_DATA=$(INSTALL_DATA)" "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" "LDFLAGS=$(LDFLAGS)" "LIBCFLAGS=$(LIBCFLAGS)" "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" "MAKE=$(MAKE)" "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" "PICFLAG=$(PICFLAG)" "PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" "SHELL=$(SHELL)" "EXPECT=$(EXPECT)" "RUNTEST=$(RUNTEST)" "RUNTESTFLAGS=$(RUNTESTFLAGS)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "includedir=$(includedir)" "prefix=$(prefix)" "tooldir=$(tooldir)" "AR=$(AR)" "AS=$(AS)" "CC=$(CC)" "CXX=$(CXX)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "NM=$(NM)" "NM_FOR_BUILD=$(NM_FOR_BUILD)" "NM_FOR_TARGET=$(NM_FOR_TARGET)" "DESTDIR=$(DESTDIR)" "WERROR=$(WERROR)"
AM_MAKEFLAGS = \
"AR_FLAGS=$(AR_FLAGS)" \
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
"CFLAGS=$(CFLAGS)" \
"CXXFLAGS=$(CXXFLAGS)" \
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
"LDFLAGS=$(LDFLAGS)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
"MAKE=$(MAKE)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
"SHELL=$(SHELL)" \
"EXPECT=$(EXPECT)" \
"RUNTEST=$(RUNTEST)" \
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
"exec_prefix=$(exec_prefix)" \
"infodir=$(infodir)" \
"libdir=$(libdir)" \
"includedir=$(includedir)" \
"prefix=$(prefix)" \
"tooldir=$(tooldir)" \
"AR=$(AR)" \
"AS=$(AS)" \
"CC=$(CC)" \
"CXX=$(CXX)" \
"LD=$(LD)" \
"LIBCFLAGS=$(LIBCFLAGS)" \
"PICFLAG=$(PICFLAG)" \
"RANLIB=$(RANLIB)" \
"NM=$(NM)" \
"NM_FOR_BUILD=$(NM_FOR_BUILD)" \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"DESTDIR=$(DESTDIR)" \
"WERROR=$(WERROR)"
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
CONFIG_HEADER = config.h
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 17</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.6 2000/12/03 23:47:47 jsm28 Exp $ -->
<!-- $Id: howto.html,v 1.1 2000/12/10 04:03:09 pme Exp $ -->
</HEAD>
<BODY>
......@@ -144,9 +144,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.6 2000/12/03 23:47:47 jsm28 Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:03:09 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 18</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.7 2000/12/03 23:47:47 jsm28 Exp $ -->
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $ -->
</HEAD>
<BODY>
......@@ -259,9 +259,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.7 2000/12/03 23:47:47 jsm28 Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 19</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $ -->
<!-- $Id: howto.html,v 1.2 2001/03/25 00:01:56 pme Exp $ -->
</HEAD>
<BODY>
......@@ -26,7 +26,7 @@
<UL>
<LI><A HREF="#1">Adding data to exceptions</A>
<LI><A HREF="#2">Exception class hierarchy diagram</A>
<LI><A HREF="#3">Concept checkers</A>
<LI><A HREF="#3">Concept checkers -- <STRONG>new and improved!</STRONG></A>
</UL>
<HR>
......@@ -67,58 +67,44 @@
</P>
<HR>
<H2><A NAME="3">Concept checkers</A></H2>
<P>First the good news, then the bad news.</P>
<P><STRONG>Good news:</STRONG> As part of their 3.3 release, SGI
added some nifty macros which
perform assertions on type properties. For example, the Standard
requires that types passed as template parameters to <TT>vector</TT>
be &quot;Assignable&quot; (which means what you think it means).
<H2><A NAME="3">Concept checkers -- <STRONG>new and improved!</STRONG></A></H2>
<P>Better taste! Less fat! Literally!</P>
<P>In 1999, SGI added <EM>concept checkers</EM> to their implementation
of the STL: code which checked the template parameters of
instantiated pieces of the STL, in order to insure that the parameters
being used met the requirements of the standard. For example,
the Standard requires that types passed as template parameters to
<TT>vector</TT> be &quot;Assignable&quot; (which means what you think
it means). The checking was done during compilation, and none of
the code was executed at runtime.
</P>
<P>The concept checkers allow the source code for <TT>vector</TT> to
declare
<PRE>
__STL_CLASS_REQUIRES(_Tp, _Assignable);
</PRE>inside the template. <TT>_Tp</TT> is the element type of the
vector, and <TT>_Assignable</TT> is the concept to be checked (it is
defined in some back-end header files). When you instantiate
<TT>vector&lt;MyType&gt;</TT>, compile-time checking can be done on
whether MyType meets the requirements for vectors.
<P>Unfortunately, the size of the compiler files grew significantly
as a result. The checking code itself was cumbersome. And bugs
were found in it on more than one occasion.
</P>
<P>Most (all?) of the containers and sequences are capable of performing
concept checking during compilation, not just vector.
<P>The primary author of the checking code, Jeremy Siek, had already
started work on a replcement implementation. The new code has been
formally reviewed and accepted into
<A HREF="http://www.boost.org/libs/concept_check/concept_check.htm">the
Boost libraries</A>, and we are pleased to incorporate it into the
GNU C++ library.
</P>
<P>If a concept is violated (thus causing a compilation failure), the
error messages printed by the compiler will be of the form
<PRE>
_STL_ERROR::__<EM>foo</EM>_violation
</PRE> where <EM>foo</EM> is a description of the precise violation.
For example, if a type is required to support the preincrement
operator but doesn't, then you will see
_STL_ERROR::__postincrement_operator_requirement_violation, which
should give you a hint as to the nature of the problem.
<P>The new version imposes a much smaller space overhead on the generated
object file. The checks are also cleaner and easier to read and
understand.
</P>
<P>Other names might be seen for more specific errors, for example,
_ERROR_IN_STL_CONTAINER::__begin_iterator_accessor_requirement_violation.
<P>Concept checking can be disabled when you build your code, for example,
to save space during a production build. Just define (via -D or
#define) any of the macros
<TT>_GLIBCPP_NO_CONCEPT_CHECKS (yes, with the leading underscore),
<TT>_STL_NO_CONCEPT_CHECKS</TT> (also with the leading underscore),
or <TT>NDEBUG</TT>. The first macro is specifically for this
feature, the second is the disabling macro for the replaced SGI
version (some code may assume SGI's version is in use), and the third
is the usual macro to disable <TT>assert()</TT>, which is often turned
off for production builds.
</P>
<P>You will probably also see other errors as the malformed code is
actually used. The concept checking error messages should be printed
before the others, so start at the top and work your way down.
</P>
<P><STRONG>Bad news:</STRONG> The current checking code is somewhat
messy. It results in no runtime overhead, but there is a space
penalty (sometimes a very large one) in the generated code. And the
code itself has bugs.
</P>
<P>Concept checking can be disabled when you build your code. Just
define (via -D or #define) the macro
<TT>_STL_NO_CONCEPT_CHECKS</TT> (yes, with the leading underscore).
In fact, this may already be defined in the library by default,
depending on what decision we come to.
</P>
<P><STRONG>More good news:</STRONG> Replacement code has already been
written by the same author of the original code. It's available at
Boost and we hope to integrate it into the library.
<P>Return <A HREF="#top">to top of page</A> or
<A HREF="../faq/index.html">to the FAQ</A>.
</P>
......@@ -129,9 +115,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.2 2001/03/25 00:01:56 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 20</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $ -->
<!-- $Id: howto.html,v 1.2 2001/01/23 17:02:27 pme Exp $ -->
</HEAD>
<BODY>
......@@ -212,9 +212,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:54 pme Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.2 2001/01/23 17:02:27 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 21</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $ -->
<!-- $Id: howto.html,v 1.2 2001/02/07 00:03:20 pme Exp $ -->
</HEAD>
<BODY>
......@@ -329,9 +329,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.2 2001/02/07 00:03:20 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 22</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $ -->
<!-- $Id: howto.html,v 1.2 2001/02/07 00:03:20 pme Exp $ -->
</HEAD>
<BODY>
......@@ -225,9 +225,8 @@ functionality are given.
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.2 2001/02/07 00:03:20 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 23</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.4 2000/12/03 23:47:48 jsm28 Exp $ -->
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $ -->
</HEAD>
<BODY>
......@@ -235,9 +235,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.4 2000/12/03 23:47:48 jsm28 Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 24</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.5 2000/12/03 23:47:48 jsm28 Exp $ -->
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $ -->
</HEAD>
<BODY>
......@@ -84,9 +84,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.5 2000/12/03 23:47:48 jsm28 Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 25</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.5 2000/12/03 23:47:48 jsm28 Exp $ -->
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $ -->
</HEAD>
<BODY>
......@@ -86,9 +86,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.5 2000/12/03 23:47:48 jsm28 Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:55 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 26</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.7 2000/12/03 23:47:48 jsm28 Exp $ -->
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:56 pme Exp $ -->
</HEAD>
<BODY>
......@@ -132,9 +132,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.7 2000/12/03 23:47:48 jsm28 Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:56 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Chapter 27</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.2 2001/01/23 17:02:27 pme Exp $ -->
<!-- $Id: howto.html,v 1.3 2001/02/07 00:03:21 pme Exp $ -->
</HEAD>
<BODY>
......@@ -415,9 +415,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.2 2001/01/23 17:02:27 pme Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.3 2001/02/07 00:03:21 pme Exp $
</EM></P>
......
......@@ -8,7 +8,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 HOWTO: Extensions</TITLE>
<LINK REL=StyleSheet HREF="../lib3styles.css">
<!-- $Id: howto.html,v 1.1 2000/12/10 04:04:56 pme Exp $ -->
<!-- $Id: howto.html,v 1.2 2001/03/25 00:01:56 pme Exp $ -->
</HEAD>
<BODY>
......@@ -141,8 +141,8 @@
<HR>
<H2><A NAME="4">Compile-time checks</A></H2>
<P>Currently libstdc++-v3 uses the concept checkers from SGI's STL
3.3 to perform <A HREF="../19_diagnostics/howto.html#3">optional
<P>Currently libstdc++-v3 uses the concept checkers from the Boost
library to perform <A HREF="../19_diagnostics/howto.html#3">optional
compile-time checking</A> of template instantiations of the standard
containers. They are described in the linked-to page.
</P>
......@@ -158,9 +158,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: howto.html,v 1.1 2000/12/10 04:04:56 pme Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: howto.html,v 1.2 2001/03/25 00:01:56 pme Exp $
</EM></P>
......
......@@ -9,7 +9,7 @@
** Locations of "the most recent snapshot is the Nth" text are
** answers 1_1, 1_4, 4_1, 5_6.
-->
<!-- $Id: index.html,v 1.4 2001/03/01 22:32:23 pme Exp $ -->
<!-- $Id: index.html,v 1.5 2001/03/25 00:01:57 pme Exp $ -->
</HEAD>
<BODY>
......@@ -62,15 +62,16 @@ http://gcc.gnu.org/onlinedocs/libstdc++/faq/</A>.</P>
<LI><A HREF="#4_2">Bugs in gcc/g++ (not libstdc++-v3)</A>
<LI><A HREF="#4_3">Bugs in the C++ language/lib specification</A>
<LI><A HREF="#4_4">Things in libstdc++ that look like bugs</A>
<UL>
<UL>
<LI><A HREF="#4_4_Weff">-Weffc++ complains too much</A>
<LI><A HREF="#4_4_rel_ops">&quot;ambiguous overloads&quot;
after including an old-style header</A>
after including an old-style header</A>
<LI><A HREF="#4_4_interface">The g++-3 headers are
<STRONG>not ours</STRONG></A>
<LI><A HREF="#4_4_glibc">compilation errors from streambuf.h</A>
<LI><A HREF="#4_4_checks">_STL_ERROR::__something_huge_...</A>
</UL>
<LI><A HREF="#4_4_checks">errors about <EM>*Cconcept</EM> and
<EM>constraints</EM> in the STL...</A>
</UL>
<LI><A HREF="#4_5">Aw, that's easy to fix!</A>
</OL>
......@@ -258,7 +259,7 @@ which is no longer available, thanks deja...-->
that building GCC is much easier and more automated
than building the GCC 2.[78] series was.
<LI> If you plan on hacking around with the makefiles, you
will need the tools <A
will need the tools <A
HREF="http://sources.redhat.com/autoconf/">autoconf</A>and <A
HREF="http://sources.redhat.com/automake/">automake</A>.
<LI> GNU Make is the only make that supports these makefiles.
......@@ -289,11 +290,11 @@ HREF="http://sources.redhat.com/automake/">automake</A>.
keep mentioning?</A></H2>
<P>The <EM>Concurrent Versions System</EM> is one of several revision
control packages. It was selected for GNU projects because it's
free (speech), free (beer), and very high quality. The <A
free (speech), free (beer), and very high quality. The <A
HREF="http://www.gnu.org/software/cvs/cvs.html">CVS entry in
the GNU software catalogue</A> has a better description as
well as a
<A HREF="http://www.cyclic.com/">link to the makers of CVS</A>.
<A HREF="http://www.cyclic.com/">link to the makers of CVS</A>.
</P>
<P>The &quot;anonymous client checkout&quot; feature of CVS is
similar to anonymous FTP in that it allows anyone to retrieve
......@@ -371,7 +372,7 @@ HREF="http://sources.redhat.com/automake/">automake</A>.
</P>
<P>You have two options. You can get a newer cygwin1.dll (see the
Cygwin paragraph in the
<A HREF="../install.html">installation instructions</A>).
<A HREF="../install.html">installation instructions</A>).
Or you can get a prebuilt set of bits/std_limits.h and
src/limitsMEMBERS.cc files from Mumit Khan's
<A HREF="http://www.xraylith.wisc.edu/~khan/software/gnu-win32/libstdc++-v3.html">Cygwin-related website</A>.
......@@ -381,15 +382,15 @@ HREF="http://sources.redhat.com/automake/">automake</A>.
<H2><A NAME="3_3">3.3 Building DEC OSF kills the assembler</A></H2>
<P>The <TT>atomicity.h</TT> header for the Alpha processor
currently uses pseudo-operators which the DEC assembler
doesn't understand (in particular, .subsection and .previous).
The simple solution is to install GNU <TT>as</TT> and arrange
for the GCC build to use it (or merge the sources and build
it during the bootstrap).
doesn't understand (in particular, .subsection and .previous).
The simple solution is to install GNU <TT>as</TT> and arrange
for the GCC build to use it (or merge the sources and build
it during the bootstrap).
</P>
<P>Anyone who
<A HREF="http://gcc.gnu.org/ml/libstdc++/2000-12/msg00279.html">knows
the DEC assembler well enough</A> to provide the equivalent of
these two pseudos would win praise and accolades from many.
the DEC assembler well enough</A> to provide the equivalent of
these two pseudos would win praise and accolades from many.
</P>
......@@ -511,12 +512,12 @@ to the list</A>, Nathan Myers announced that he has started a list of
<A NAME="4_4_rel_ops">
<P>Another is the <TT>rel_ops</TT> namespace and the template
comparison operator functions contained therein. If they become
visible in the same namespace as other comparison functions
(e.g., '<TT>using</TT>' them and the &lt;iterator&gt; header),
then you will suddenly be faced with huge numbers of ambiguity
errors. This was discussed on the -v3 list; Nathan Myers
<A HREF="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html">sums
things up here</A>.
visible in the same namespace as other comparison functions
(e.g., '<TT>using</TT>' them and the &lt;iterator&gt; header),
then you will suddenly be faced with huge numbers of ambiguity
errors. This was discussed on the -v3 list; Nathan Myers
<A HREF="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html">sums
things up here</A>.
</P>
</A>
<A NAME="4_4_interface"><H3>The g++-3 headers are
......@@ -541,8 +542,8 @@ to the list</A>, Nathan Myers announced that he has started a list of
</A>
<A NAME="4_4_glibc">
<P>If you're on a GNU/Linux system and have just upgraded to
glibc 2.2, but are still using gcc 2.95.2, then you should have
read the glibc FAQ, specifically 2.34:
glibc 2.2, but are still using gcc 2.95.2, then you should have
read the glibc FAQ, specifically 2.34:
<PRE>
2.34. When compiling C++ programs, I get a compilation error in streambuf.h.
......@@ -551,24 +552,24 @@ apply a patch to the include files in /usr/include/g++, because the fpos_t
type has changed in glibc 2.2. The patch is at
http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
</PRE>
Note that 2.95.x shipped with the
<A HREF="#4_4_interface">old v2 library</A> which is no longer
maintained.
Note that 2.95.x shipped with the
<A HREF="#4_4_interface">old v2 library</A> which is no longer
maintained.
</P>
</A>
<A NAME="4_4_checks">
<P>If you see compilation errors containing messages which begin
with _STL_ERROR:: followed by a very verbose name, then most
likely you have violated one of the requirements for types used
during instantiation of template containers. For example,
_STL_ERROR::__equality_comparable_requirement_violation appears
<P>If you see compilation errors containing messages about
<TT> <EM>foo</EM>Concept </TT>and a<TT> constraints </TT>
member function, then most
likely you have violated one of the requirements for types used
during instantiation of template containers. For example,
EqualityComparableConcept appears
if your types must be comparable with == and you have not
provided this capability (a typo, or wrong visibility, or you
just plain forgot, etc).
just plain forgot, etc).
</P>
<P>More information, including how to optionally disable the checks,
is available <A HREF="../19_diagnostics/howto.html#3">here</A>.
The code itself might be disabled or replaced already.
<P>More information, including how to optionally disable the checks,
is available <A HREF="../19_diagnostics/howto.html#3">here</A>.
</P>
</A>
......@@ -579,7 +580,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
on <A HREF="http://gcc.gnu.org/contribute.html">submitting
patches</A> that covers the procedure, but for libstdc++ you
should also send the patch to our mailing list in addition to
the GCC patches mailing list. The libstdc++
the GCC patches mailing list. The libstdc++
<A HREF="../17_intro/contribute.html">contributors' page</A>
also talks about how to submit patches.
</P>
......@@ -720,9 +721,8 @@ HREF="http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html">speculation</A>.
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: index.html,v 1.4 2001/03/01 22:32:23 pme Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: index.html,v 1.5 2001/03/25 00:01:57 pme Exp $
</EM></P>
......
......@@ -38,7 +38,7 @@
header
o [28]The g++-3 headers are not ours
o [29]compilation errors from streambuf.h
o [30]_STL_ERROR::__something_huge_...
o [30]errors about *Cconcept and constraints in the STL...
5. [31]Aw, that's easy to fix!
5. [32]Miscellaneous
1. [33]string::iterator is not char*; vector<T>::iterator is not
......@@ -440,18 +440,16 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
Note that 2.95.x shipped with the [68]old v2 library which is no
longer maintained.
If you see compilation errors containing messages which begin with
_STL_ERROR:: followed by a very verbose name, then most likely you
have violated one of the requirements for types used during
instantiation of template containers. For example,
_STL_ERROR::__equality_comparable_requirement_violation appears if
your types must be comparable with == and you have not provided this
If you see compilation errors containing messages about fooConcept and
a constraints member function, then most likely you have violated one
of the requirements for types used during instantiation of template
containers. For example, EqualityComparableConcept appears if your
types must be comparable with == and you have not provided this
capability (a typo, or wrong visibility, or you just plain forgot,
etc).
More information, including how to optionally disable the checks, is
available [69]here. The code itself might be disabled or replaced
already.
available [69]here.
_________________________________________________________________
4.5 Aw, that's easy to fix!
......@@ -573,9 +571,9 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
out!
_________________________________________________________________
Comments and suggestions are welcome, and may be sent to [83]Phil
Edwards or [84]Gabriel Dos Reis.
$Id: index.html,v 1.4 2001/03/01 22:32:23 pme Exp $
Comments and suggestions are welcome, and may be sent to [83]the
mailing list.
$Id: index.html,v 1.5 2001/03/25 00:01:57 pme Exp $
References
......@@ -661,5 +659,4 @@ References
80. http://www.ansi.org/
81. http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998
82. http://www.iso.ch/
83. mailto:pme@sources.redhat.com
84. mailto:gdr@gcc.gnu.org
83. mailto:libstdc++@gcc.gnu.org
......@@ -7,7 +7,7 @@
<META NAME="GENERATOR" CONTENT="vi and eight fingers">
<TITLE>libstdc++-v3 Installation Instructions</TITLE>
<LINK REL=StyleSheet HREF="lib3styles.css">
<!-- $Id: install.html,v 1.3 2001/01/23 17:02:26 pme Exp $ -->
<!-- $Id: install.html,v 1.4 2001/02/07 00:03:20 pme Exp $ -->
</HEAD>
<BODY>
......@@ -333,9 +333,8 @@
<HR>
<P CLASS="fineprint"><EM>
Comments and suggestions are welcome, and may be sent to
<A HREF="mailto:pme@sources.redhat.com">Phil Edwards</A> or
<A HREF="mailto:gdr@gcc.gnu.org">Gabriel Dos Reis</A>.
<BR> $Id: install.html,v 1.3 2001/01/23 17:02:26 pme Exp $
<A HREF="mailto:libstdc++@gcc.gnu.org">the mailing list</A>.
<BR> $Id: install.html,v 1.4 2001/02/07 00:03:20 pme Exp $
</EM></P>
......
......@@ -63,9 +63,8 @@
# define __STL_UITHREADS
#endif
// Concept-checking code is off by default unless users define
// the _STL_USE_CONCEPT_CHECKS hook.
//#define _STL_USE_CONCEPT_CHECKS 1
// Concept-checking hooks and related config are now in bits/concept_check.h.
// This is also a user hook, but via -f[no-]exceptions, not direct #defines.
#ifdef __EXCEPTIONS
......@@ -85,7 +84,8 @@
# define __STL_UNWIND(action)
#endif
// This is the "underlying allocator"
// This is the "underlying allocator" for STL. The alternatives are
// homegrown schemes involving a kind of mutex and free list; see stl_alloc.h.
#define __USE_MALLOC
// Define this to permit user-level control of the expansion of string
......@@ -105,11 +105,6 @@
//# define __STL_LONG_LONG
//#endif
// 20010302 pme -- this is only used in bits/concept_checks.h
//#if (__GNUC__ < 2) || (__GNUC__ == 2 && __GNUC_MINOR__ < 95)
# define __STL_NO_FUNCTION_PTR_IN_CLASS_TEMPLATE
//#endif
// Mingw32, GCC compiler using the Microsoft C runtime (settings taken from
// SGI's stl_config.h)
#if defined(__MINGW32__)
......
// Concept-checking control -*- C++ -*-
// Copyright (C) 2001 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
#ifndef _GLIBCPP_CONCEPT_CHECK
#define _GLIBCPP_CONCEPT_CHECK 1
#pragma GCC system_header
#include <bits/c++config.h>
// Concept-checking code is on by default unless users turn it off via any
// of these methods:
// - _GLIBCPP_NO_CONCEPT_CHECKS is a user hook; defining it disables the
// checks.
// - _STL_NO_CONCEPT_CHECKS is a user hook from the old STL implementation
// specifically for this purpose; defining it disables the checks, in
// case the user is expecting the old version.
// - NDEBUG is the usual macro that kills assert(). Defining it will also
// disable the checks, by the reasoning that if the user doesn't want
// any runtime assertion code, then no space penalty for the checks
// is desired either.
// All places in libstdc++-v3 where these are used, or /might/ be used, or
// don't need to be used, or perhaps /should/ be used, are commented with
// "concept requirements" (and maybe some more text). So grep like crazy
// if you're looking for additional places to use these.
#if defined(_GLIBCPP_NO_CONCEPT_CHECKS) || defined(_STL_NO_CONCEPT_CHECKS) \
|| defined(NDEBUG)
#define glibcpp_function_requires(...)
#define glibcpp_class_requires(a,b)
#define glibcpp_class_requires2(a,b,c)
#define glibcpp_class_requires3(a,b,c,d)
#define glibcpp_class_requires4(a,b,c,d,e)
#else // the checks are on
#include <bits/boost_concept_check.h>
// Note that the obvious and elegant approach of
//
//#define glibcpp_function_requires(C) \
// boost::function_requires< boost::C >()
//
// won't work due to concept templates with more than one parameter, e.g.,
// BinaryPredicateConcept. The preprocessor tries to split things up on
// the commas in the template argument list. We can't use an inner pair of
// parenthesis to hide the commas, because "boost::(Temp<Foo,Bar>)" isn't
// a valid instantiation pattern.
#define glibcpp_function_requires(...) \
boost::function_requires< boost::__VA_ARGS__ >()
#define glibcpp_class_requires(a,C) \
BOOST_CLASS_REQUIRES(a, boost, C)
#define glibcpp_class_requires2(a,b,C) \
BOOST_CLASS_REQUIRES2(a, b, boost, C)
#define glibcpp_class_requires3(a,b,c,C) \
BOOST_CLASS_REQUIRES3(a, b, c, boost, C)
#define glibcpp_class_requires4(a,b,c,d,C) \
BOOST_CLASS_REQUIRES4(a, b, c, d, boost, C)
#endif // enable/disable
#endif // _GLIBCPP_CONCEPT_CHECK
/*
* Copyright (c) 1999
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
#ifndef __STL_CONTAINER_CONCEPTS_H
#define __STL_CONTAINER_CONCEPTS_H
#include <bits/concept_checks.h>
#ifdef __STL_USE_CONCEPT_CHECKS
// This file covers the following concepts:
// _Container
// _ForwardContainer
// _ReversibleContainer
// _const_ReversibleContainer
// _RandomAccessContainer
//
struct _ERROR_IN_STL_CONTAINER {
/* Container expresssions */
template <class _Container>
static void
__begin_iterator_accessor_requirement_violation(_Container __c) {
__c.begin();
}
template <class _Container>
static void
__const_begin_iterator_accessor_requirement_violation(const _Container& __c) {
__c.begin();
}
template <class _Container>
static void
__end_iterator_accessor_requirement_violation(_Container __c) {
__c.end();
}
template <class _Container>
static void
__const_end_iterator_accessor_requirement_violation(const _Container& __c) {
__c.end();
}
template <class _Container>
static void
__rbegin_iterator_accessor_requirement_violation(_Container __c) {
__c.rbegin();
}
template <class _Container>
static void
__const_rbegin_iterator_accessor_requirement_violation(const _Container& __c) {
__c.rbegin();
}
template <class _Container>
static void
__rend_iterator_accessor_requirement_violation(_Container __c) {
__c.rend();
}
template <class _Container>
static void
__const_rend_iterator_accessor_requirement_violation(const _Container& __c) {
__c.rend();
}
template <class _Container>
static void
__size_function_must_be_const(const _Container& __c) {
__c.size();
}
template <class _Container>
static void
__size_function_requirement_violation(_Container& __c) {
__c.size();
__size_function_must_be_const(__c);
}
template <class _Container>
static void
__max_size_function_must_be_const(const _Container& __c) {
__c.max_size();
}
template <class _Container>
static void
__max_size_function_requirement_violation(_Container& __c) {
__c.max_size();
__max_size_function_must_be_const(__c);
}
template <class _Container>
static void
__empty_function_must_be_const(const _Container& __c) {
__c.empty();
}
template <class _Container>
static void
__empty_function_requirement_violation(_Container& __c) {
__c.empty();
__empty_function_must_be_const(__c);
}
template <class _Container>
static void
__swap_function_requirement_violation(_Container& __c) {
__c.swap(__c);
}
};
__STL_TYPEDEF_REQUIREMENT(iterator);
__STL_TYPEDEF_REQUIREMENT(const_iterator);
/* Containers */
template <class _Container>
struct _Container_concept_specification {
static void
_Container_requirement_violation(_Container __c) {
// Refinement of Assignable
_Assignable_concept_specification<_Container>::_Assignable_requirement_violation(__c);
// Associated Types
__value_type__typedef_requirement_violation<_Container>();
__difference_type__typedef_requirement_violation<_Container>();
__size_type__typedef_requirement_violation<_Container>();
__reference__typedef_requirement_violation<_Container>();
__const_reference__typedef_requirement_violation<_Container>();
__pointer__typedef_requirement_violation<_Container>();
__const_pointer__typedef_requirement_violation<_Container>();
__iterator__typedef_requirement_violation<_Container>();
__const_iterator__typedef_requirement_violation<_Container>();
// Valid Expressions
_ERROR_IN_STL_CONTAINER::__const_begin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__const_end_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__begin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__end_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__size_function_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__max_size_function_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__empty_function_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__swap_function_requirement_violation(__c);
// Requirements on Iterators
typedef typename _Container::iterator iter;
typedef typename _Container::const_iterator const_iter;
_InputIterator_concept_specification<const_iter>::_InputIterator_requirement_violation(const_iter());
_InputIterator_concept_specification<iter>::_InputIterator_requirement_violation(iter());
}
};
template <class _ForwardContainer>
struct _ForwardContainer_concept_specification {
static void
_ForwardContainer_requirement_violation(_ForwardContainer __c) {
// Refinement of Container
_Container_concept_specification<_ForwardContainer>::_Container_requirement_violation(__c);
// Requirements on Iterators
typedef typename _ForwardContainer::iterator iter;
typedef typename _ForwardContainer::const_iterator const_iter;
_ForwardIterator_concept_specification<const_iter>::_ForwardIterator_requirement_violation(const_iter());
_Mutable_ForwardIterator_concept_specification<iter>::_Mutable_ForwardIterator_requirement_violation(iter());
}
};
__STL_TYPEDEF_REQUIREMENT(reverse_iterator);
__STL_TYPEDEF_REQUIREMENT(const_reverse_iterator);
template <class _ReversibleContainer>
struct _ReversibleContainer_concept_specification {
static void
_ReversibleContainer_requirement_violation(_ReversibleContainer __c) {
// Refinement of ForwardContainer
_ForwardContainer_concept_specification<_ReversibleContainer>::_ForwardContainer_requirement_violation(__c);
// Associated types
__reverse_iterator__typedef_requirement_violation<_ReversibleContainer>();
__const_reverse_iterator__typedef_requirement_violation<_ReversibleContainer>();
// Valid Expressions
_ERROR_IN_STL_CONTAINER::__const_rbegin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__const_rend_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__rbegin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__rend_iterator_accessor_requirement_violation(__c);
// Requirements on Iterators
typedef typename _ReversibleContainer::iterator iter;
typedef typename _ReversibleContainer::const_iterator const_iter;
_BidirectionalIterator_concept_specification<const_iter>::_BidirectionalIterator_requirement_violation(const_iter());
_Mutable_BidirectionalIterator_concept_specification<iter>::_Mutable_BidirectionalIterator_requirement_violation(iter());
}
};
template <class _ReversibleContainer>
struct _const_ReversibleContainer_concept_specification {
static void
_const_ReversibleContainer_requirement_violation(_ReversibleContainer __c) {
// Refinement of Container (JGS, not ForwardContainer)
_Container_concept_specification<_ReversibleContainer>::_Container_requirement_violation(__c);
// Associated types
__reverse_iterator__typedef_requirement_violation<_ReversibleContainer>();
__const_reverse_iterator__typedef_requirement_violation<_ReversibleContainer>();
// Valid Expressions
_ERROR_IN_STL_CONTAINER::__const_rbegin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__const_rend_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__rbegin_iterator_accessor_requirement_violation(__c);
_ERROR_IN_STL_CONTAINER::__rend_iterator_accessor_requirement_violation(__c);
// Requirements on Iterators
typedef typename _ReversibleContainer::iterator iter;
typedef typename _ReversibleContainer::const_iterator const_iter;
_BidirectionalIterator_concept_specification<const_iter>::_BidirectionalIterator_requirement_violation(const_iter());
}
};
template <class _RandomAccessContainer>
struct _RandomAccessContainer_concept_specification {
static void
_RandomAccessContainer_requirement_violation(_RandomAccessContainer __c) {
// Refinement of ReversibleContainer
_ReversibleContainer_concept_specification<_RandomAccessContainer>::_ReversibleContainer_requirement_violation(__c);
// Valid Expressions
typedef typename _RandomAccessContainer::value_type __T;
typedef typename _RandomAccessContainer::difference_type _Dist;
typedef typename _Mutable_trait<__T>::_Type Type;
typedef Type* _TypePtr;
typedef typename _Mutable_trait<_Dist>::_Type Dist;
_STL_ERROR::__element_access_operator_requirement_violation(__c,
_TypePtr(),
Dist());
// Requirements on Iterators
typedef typename _RandomAccessContainer::iterator iter;
typedef typename _RandomAccessContainer::const_iterator const_iter;
_RandomAccessIterator_concept_specification<const_iter>::_RandomAccessIterator_requirement_violation(const_iter());
_Mutable_RandomAccessIterator_concept_specification<iter>::_Mutable_RandomAccessIterator_requirement_violation(iter());
}
};
#endif /* if __STL_USE_CONCEPT_CHECKS */
#endif /* __STL_CONTAINER_CONCEPTS_H */
......@@ -39,7 +39,7 @@ namespace std
template<typename _CharT, typename _Traits>
class ostreambuf_iterator
#if 0 // XXX this is standard:
#if 1 // XXX this is standard:
: public iterator<output_iterator_tag, _CharT, void, void, void>
#else
: public output_iterator
......
/*
* Copyright (c) 1999
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
#ifndef _STL_SEQUENCE_CONCEPTS_H
#define _STL_SEQUENCE_CONCEPTS_H 1
#pragma GCC system_header
#include <bits/container_concepts.h>
#ifdef __STL_USE_CONCEPT_CHECKS
// This file covers the following concepts:
// _Sequence
// _FrontInsertionSequence
// _BackInsertionSequence
struct _ERROR_IN_STL_SEQ {
template <class _XX>
static void
__fill_constructor_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
typename _XX::difference_type __n = typename _XX::difference_type();
_XX __x(__n, __t);
__sink_unused_warning(__x);
}
template <class _XX>
static void
__fill_default_constructor_requirement_violation(_XX& __s) {
_STL_ERROR::__default_constructor_requirement_violation(*__s.begin());
typename _XX::difference_type __n = typename _XX::difference_type();
_XX __x(__n);
__sink_unused_warning(__x);
}
template <class _XX>
static void
__range_constructor_requirement_violation(_XX& __s) {
_XX __x(__s.begin(), __s.end());
__sink_unused_warning(__x);
}
template <class _XX>
static void
__insert_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
typename _XX::iterator __p = typename _XX::iterator();
__p = __s.insert(__p, __t);
}
template <class _XX>
static void
__fill_insert_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
typename _XX::iterator __p = typename _XX::iterator();
typename _XX::difference_type __n = typename _XX::difference_type();
__s.insert(__p, __n, __t);
}
template <class _XX>
static void
__range_insert_function_requirement_violation(_XX& __s) {
typename _XX::iterator __p = typename _XX::iterator();
typename _XX::iterator __i = typename _XX::iterator();
typename _XX::iterator __j = typename _XX::iterator();
__s.insert(__p, __i, __j);
}
template <class _XX>
static void
__insert_element_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
std::pair<typename _XX::iterator, bool> __r;
__r = __s.insert(__t);
__sink_unused_warning(__r);
}
template <class _XX>
static void
__unconditional_insert_element_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
typename _XX::iterator __p;
__p = __s.insert(__t);
__sink_unused_warning(__p);
}
template <class _XX>
static void
__erase_function_requirement_violation(_XX& __s) {
typename _XX::iterator __p = typename _XX::iterator();
__p = __s.erase(__p);
}
template <class _XX>
static void
__range_erase_function_requirement_violation(_XX& __s) {
typename _XX::iterator __p = typename _XX::iterator();
typename _XX::iterator __q = typename _XX::iterator();
__p = __s.erase(__p, __q);
}
template <class _XX>
static void
__const_front_function_requirement_violation(const _XX& __s) {
typename _XX::const_reference __t = __s.front();
__sink_unused_warning(__t);
}
template <class _XX>
static void
__front_function_requirement_violation(_XX& __s) {
typename _XX::reference __t = __s.front();
__const_front_function_requirement_violation(__s);
__sink_unused_warning(__t);
}
template <class _XX>
static void
__const_back_function_requirement_violation(const _XX& __s) {
typename _XX::const_reference __t = __s.back();
__sink_unused_warning(__t);
}
template <class _XX>
static void
__back_function_requirement_violation(_XX& __s) {
typename _XX::reference __t = __s.back();
__const_back_function_requirement_violation(__s);
__sink_unused_warning(__t);
}
template <class _XX>
static void
__push_front_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
__s.push_front(__t);
}
template <class _XX>
static void
__pop_front_function_requirement_violation(_XX& __s) {
__s.pop_front();
}
template <class _XX>
static void
__push_back_function_requirement_violation(_XX& __s) {
typename _XX::value_type __t = typename _XX::value_type();
__s.push_back(__t);
}
template <class _XX>
static void
__pop_back_function_requirement_violation(_XX& __s) {
__s.pop_back();
}
};
/* Sequence Containers */
template <class _Sequence>
struct _Sequence_concept_specification {
static void
_Sequence_requirement_violation(_Sequence __s) {
// Refinement of ForwardContainer
_ForwardContainer_concept_specification<_Sequence>::_ForwardContainer_requirement_violation(__s);
// Refinement of DefaultConstructible
_DefaultConstructible_concept_specification<_Sequence>::_DefaultConstructible_requirement_violation(__s);
// Valid Expressions
_ERROR_IN_STL_SEQ::__fill_constructor_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__fill_default_constructor_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__range_constructor_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__insert_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__fill_insert_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__range_insert_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__erase_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__range_erase_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__front_function_requirement_violation(__s);
}
};
template <class _FrontInsertionSequence>
struct _FrontInsertionSequence_concept_specification {
static void
_FrontInsertionSequence_requirement_violation(_FrontInsertionSequence __s) {
// Refinement of Sequence
_Sequence_concept_specification<_FrontInsertionSequence>::_Sequence_requirement_violation(__s);
// Valid Expressions
_ERROR_IN_STL_SEQ::__push_front_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__pop_front_function_requirement_violation(__s);
}
};
template <class _BackInsertionSequence>
struct _BackInsertionSequence_concept_specification {
static void
_BackInsertionSequence_requirement_violation(_BackInsertionSequence __s) {
// Refinement of Sequence
_Sequence_concept_specification<_BackInsertionSequence>::_Sequence_requirement_violation(__s);
// Valid Expressions
_ERROR_IN_STL_SEQ::__back_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__push_back_function_requirement_violation(__s);
_ERROR_IN_STL_SEQ::__pop_back_function_requirement_violation(__s);
}
};
#endif /* if __STL_USE_CONCEPT_CHECKS */
#endif /* _STL_SEQUENCE_CONCEPTS_H */
......@@ -31,7 +31,8 @@
#include <bits/c++config.h>
#include <bits/std_cstddef.h>
#include <bits/std_iosfwd.h>
#include <bits/stl_iterator_base.h>
#include <bits/stl_iterator_base_types.h>
#include <bits/stl_iterator_base_funcs.h>
#include <bits/stl_iterator.h>
#endif /* _CPP_ITERATOR */
......
......@@ -20,7 +20,7 @@
#include <bits/stl_algobase.h>
#include <bits/stl_alloc.h>
#include <bits/stl_construct.h>
#include <bits/stl_iterator_base.h> //for iterator_traits
#include <bits/stl_iterator_base_types.h> //for iterator_traits
#include <bits/stl_tempbuf.h>
#include <bits/stl_uninitialized.h>
#include <bits/stl_raw_storage_iter.h>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -81,7 +81,7 @@ __destroy(_ForwardIterator __first, _ForwardIterator __last, _Tp*)
template <class _ForwardIterator>
inline void _Destroy(_ForwardIterator __first, _ForwardIterator __last) {
__destroy(__first, __last, __VALUE_TYPE(__first));
__destroy(__first, __last, __value_type(__first));
}
inline void _Destroy(char*, char*) {}
......
......@@ -28,7 +28,9 @@
* You should not attempt to use it directly.
*/
#include <bits/concept_checks.h>
#include <bits/concept_check.h>
#include <bits/stl_iterator_base_types.h>
#include <bits/stl_iterator_base_funcs.h>
#ifndef __SGI_STL_INTERNAL_DEQUE_H
#define __SGI_STL_INTERNAL_DEQUE_H
......@@ -354,9 +356,8 @@ _Deque_base<_Tp,_Alloc>::_M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish)
template <class _Tp, class _Alloc = allocator<_Tp> >
class deque : protected _Deque_base<_Tp, _Alloc> {
// requirements:
__STL_CLASS_REQUIRES(_Tp, _Assignable);
// concept requirements
glibcpp_class_requires(_Tp, SGIAssignableConcept);
typedef _Deque_base<_Tp, _Alloc> _Base;
public: // Basic types
......@@ -469,7 +470,7 @@ public: // Constructor, destructor.
template <class _InputIter>
void _M_initialize_dispatch(_InputIter __first, _InputIter __last,
__false_type) {
_M_range_initialize(__first, __last, __ITERATOR_CATEGORY(__first));
_M_range_initialize(__first, __last, __iterator_category(__first));
}
~deque() { destroy(_M_start, _M_finish); }
......@@ -531,7 +532,7 @@ private: // helper functions for assign()
template <class _InputIterator>
void _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
__false_type) {
_M_assign_aux(__first, __last, __ITERATOR_CATEGORY(__first));
_M_assign_aux(__first, __last, __iterator_category(__first));
}
template <class _InputIterator>
......@@ -653,7 +654,7 @@ public: // Insert
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
insert(__pos, __first, __last, __ITERATOR_CATEGORY(__first));
insert(__pos, __first, __last, __iterator_category(__first));
}
void resize(size_type __new_size, const value_type& __x) {
......
......@@ -62,11 +62,14 @@ template <class _RandomAccessIterator>
inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
__STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
__STL_REQUIRES(typename iterator_traits<_RandomAccessIterator>::value_type,
_LessThanComparable);
// concept requirements
glibcpp_function_requires(Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
glibcpp_function_requires(LessThanComparableConcept<
typename iterator_traits<_RandomAccessIterator>::value_type>);
__push_heap_aux(__first, __last,
__DISTANCE_TYPE(__first), __VALUE_TYPE(__first));
__distance_type(__first), __value_type(__first));
}
template <class _RandomAccessIterator, class _Distance, class _Tp,
......@@ -100,9 +103,12 @@ inline void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Compare __comp)
{
__STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
// concept requirements
glibcpp_function_requires(Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
__push_heap_aux(__first, __last, __comp,
__DISTANCE_TYPE(__first), __VALUE_TYPE(__first));
__distance_type(__first), __value_type(__first));
}
template <class _RandomAccessIterator, class _Distance, class _Tp>
......@@ -141,17 +147,20 @@ __pop_heap_aux(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Tp*)
{
__pop_heap(__first, __last - 1, __last - 1,
_Tp(*(__last - 1)), __DISTANCE_TYPE(__first));
_Tp(*(__last - 1)), __distance_type(__first));
}
template <class _RandomAccessIterator>
inline void pop_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last)
{
__STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
__STL_REQUIRES(typename iterator_traits<_RandomAccessIterator>::value_type,
_LessThanComparable);
__pop_heap_aux(__first, __last, __VALUE_TYPE(__first));
// concept requirements
glibcpp_function_requires(Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
glibcpp_function_requires(LessThanComparableConcept<
typename iterator_traits<_RandomAccessIterator>::value_type>);
__pop_heap_aux(__first, __last, __value_type(__first));
}
template <class _RandomAccessIterator, class _Distance,
......@@ -194,7 +203,7 @@ __pop_heap_aux(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Tp*, _Compare __comp)
{
__pop_heap(__first, __last - 1, __last - 1, _Tp(*(__last - 1)), __comp,
__DISTANCE_TYPE(__first));
__distance_type(__first));
}
template <class _RandomAccessIterator, class _Compare>
......@@ -202,8 +211,11 @@ inline void
pop_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
__STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
__pop_heap_aux(__first, __last, __VALUE_TYPE(__first), __comp);
// concept requirements
glibcpp_function_requires(Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
__pop_heap_aux(__first, __last, __value_type(__first), __comp);
}
template <class _RandomAccessIterator, class _Tp, class _Distance>
......@@ -226,11 +238,14 @@ template <class _RandomAccessIterator>
inline void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
__STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
__STL_REQUIRES(typename iterator_traits<_RandomAccessIterator>::value_type,
_LessThanComparable);
// concept requirements
glibcpp_function_requires(Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
glibcpp_function_requires(LessThanComparableConcept<
typename iterator_traits<_RandomAccessIterator>::value_type>);
__make_heap(__first, __last,
__VALUE_TYPE(__first), __DISTANCE_TYPE(__first));
__value_type(__first), __distance_type(__first));
}
template <class _RandomAccessIterator, class _Compare,
......@@ -256,17 +271,23 @@ inline void
make_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
__STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
// concept requirements
glibcpp_function_requires(Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
__make_heap(__first, __last, __comp,
__VALUE_TYPE(__first), __DISTANCE_TYPE(__first));
__value_type(__first), __distance_type(__first));
}
template <class _RandomAccessIterator>
void sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
{
__STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
__STL_REQUIRES(typename iterator_traits<_RandomAccessIterator>::value_type,
_LessThanComparable);
// concept requirements
glibcpp_function_requires(Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
glibcpp_function_requires(LessThanComparableConcept<
typename iterator_traits<_RandomAccessIterator>::value_type>);
while (__last - __first > 1)
pop_heap(__first, __last--);
}
......@@ -276,7 +297,10 @@ void
sort_heap(_RandomAccessIterator __first,
_RandomAccessIterator __last, _Compare __comp)
{
__STL_REQUIRES(_RandomAccessIterator, _Mutable_RandomAccessIterator);
// concept requirements
glibcpp_function_requires(Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>);
while (__last - __first > 1)
pop_heap(__first, __last--, __comp);
}
......
/*
*
* Copyright (c) 1994
* Hewlett-Packard Company
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Hewlett-Packard Company makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*
*
* Copyright (c) 1996-1998
* Silicon Graphics Computer Systems, Inc.
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* that both that copyright notice and this permission notice appear
* in supporting documentation. Silicon Graphics makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/
/* NOTE: This is an internal header file, included by other STL headers.
* You should not attempt to use it directly.
*/
#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H
#define __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H
// This file contains all of the general iterator-related utility
// functions, such as distance() and advance().
// The internal file stl_iterator.h contains predefined iterators,
// such as front_insert_iterator and istream_iterator.
#pragma GCC system_header
#include <bits/concept_check.h>
namespace std
{
// There are two signatures for distance. In addition to the one taking
// two iterators and returning a result, there is another taking two
// iterators and a reference-to-result variable, and returning nothing.
// The latter seems to be an SGI extension. -- pedwards
template <class _InputIterator, class _Distance>
inline void __distance(_InputIterator __first, _InputIterator __last,
_Distance& __n, input_iterator_tag)
{
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIterator>);
while (__first != __last) { ++__first; ++__n; }
}
template <class _RandomAccessIterator, class _Distance>
inline void __distance(_RandomAccessIterator __first,
_RandomAccessIterator __last,
_Distance& __n, random_access_iterator_tag)
{
// concept requirements
glibcpp_function_requires(RandomAccessIteratorConcept<_RandomAccessIterator>);
__n += __last - __first;
}
template <class _InputIterator, class _Distance>
inline void distance(_InputIterator __first,
_InputIterator __last, _Distance& __n)
{
// concept requirements -- taken care of in __distance
__distance(__first, __last, __n, iterator_category(__first));
}
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
__distance(_InputIterator __first, _InputIterator __last, input_iterator_tag)
{
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIterator>);
typename iterator_traits<_InputIterator>::difference_type __n = 0;
while (__first != __last) {
++__first; ++__n;
}
return __n;
}
template <class _RandomAccessIterator>
inline typename iterator_traits<_RandomAccessIterator>::difference_type
__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
random_access_iterator_tag)
{
// concept requirements
glibcpp_function_requires(RandomAccessIteratorConcept<_RandomAccessIterator>);
return __last - __first;
}
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
distance(_InputIterator __first, _InputIterator __last)
{
// concept requirements -- taken care of in __distance
typedef typename iterator_traits<_InputIterator>::iterator_category
_Category;
return __distance(__first, __last, _Category());
}
template <class _InputIter, class _Distance>
inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag)
{
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIter>);
while (__n--) ++__i;
}
template <class _BidirectionalIterator, class _Distance>
inline void __advance(_BidirectionalIterator& __i, _Distance __n,
bidirectional_iterator_tag)
{
// concept requirements
glibcpp_function_requires(BidirectionalIteratorConcept<_BidirectionalIterator>);
if (__n >= 0)
while (__n--) ++__i;
else
while (__n++) --__i;
}
template <class _RandomAccessIterator, class _Distance>
inline void __advance(_RandomAccessIterator& __i, _Distance __n,
random_access_iterator_tag)
{
// concept requirements
glibcpp_function_requires(RandomAccessIteratorConcept<_RandomAccessIterator>);
__i += __n;
}
template <class _InputIterator, class _Distance>
inline void advance(_InputIterator& __i, _Distance __n)
{
// concept requirements -- taken care of in __advance
__advance(__i, __n, iterator_category(__i));
}
} // namespace std
#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_FUNCS_H */
// Local Variables:
// mode:C++
// End:
......@@ -28,14 +28,15 @@
* You should not attempt to use it directly.
*/
#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_H
#define __SGI_STL_INTERNAL_ITERATOR_BASE_H
#ifndef __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H
#define __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H
// This file contains all of the general iterator-related utilities.
// This file contains all of the general iterator-related utility
// types, such as iterator_traits and struct iterator.
// The internal file stl_iterator.h contains predefined iterators,
// such as front_insert_iterator and istream_iterator.
#include <bits/concept_checks.h>
#pragma GCC system header
namespace std
{
......@@ -171,93 +172,9 @@ template <class _Iter>
inline typename iterator_traits<_Iter>::value_type*
value_type(const _Iter& __i) { return __value_type(__i); }
#define __ITERATOR_CATEGORY(__i) __iterator_category(__i)
#define __DISTANCE_TYPE(__i) __distance_type(__i)
#define __VALUE_TYPE(__i) __value_type(__i)
template <class _InputIterator, class _Distance>
inline void __distance(_InputIterator __first, _InputIterator __last,
_Distance& __n, input_iterator_tag)
{
while (__first != __last) { ++__first; ++__n; }
}
template <class _RandomAccessIterator, class _Distance>
inline void __distance(_RandomAccessIterator __first,
_RandomAccessIterator __last,
_Distance& __n, random_access_iterator_tag)
{
__STL_REQUIRES(_RandomAccessIterator, _RandomAccessIterator);
__n += __last - __first;
}
template <class _InputIterator, class _Distance>
inline void distance(_InputIterator __first,
_InputIterator __last, _Distance& __n)
{
__STL_REQUIRES(_InputIterator, _InputIterator);
__distance(__first, __last, __n, iterator_category(__first));
}
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
__distance(_InputIterator __first, _InputIterator __last, input_iterator_tag)
{
typename iterator_traits<_InputIterator>::difference_type __n = 0;
while (__first != __last) {
++__first; ++__n;
}
return __n;
}
template <class _RandomAccessIterator>
inline typename iterator_traits<_RandomAccessIterator>::difference_type
__distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
random_access_iterator_tag) {
__STL_REQUIRES(_RandomAccessIterator, _RandomAccessIterator);
return __last - __first;
}
template <class _InputIterator>
inline typename iterator_traits<_InputIterator>::difference_type
distance(_InputIterator __first, _InputIterator __last) {
typedef typename iterator_traits<_InputIterator>::iterator_category
_Category;
__STL_REQUIRES(_InputIterator, _InputIterator);
return __distance(__first, __last, _Category());
}
template <class _InputIter, class _Distance>
inline void __advance(_InputIter& __i, _Distance __n, input_iterator_tag) {
while (__n--) ++__i;
}
template <class _BidirectionalIterator, class _Distance>
inline void __advance(_BidirectionalIterator& __i, _Distance __n,
bidirectional_iterator_tag) {
__STL_REQUIRES(_BidirectionalIterator, _BidirectionalIterator);
if (__n >= 0)
while (__n--) ++__i;
else
while (__n++) --__i;
}
template <class _RandomAccessIterator, class _Distance>
inline void __advance(_RandomAccessIterator& __i, _Distance __n,
random_access_iterator_tag) {
__STL_REQUIRES(_RandomAccessIterator, _RandomAccessIterator);
__i += __n;
}
template <class _InputIterator, class _Distance>
inline void advance(_InputIterator& __i, _Distance __n) {
__STL_REQUIRES(_InputIterator, _InputIterator);
__advance(__i, __n, iterator_category(__i));
}
} // namespace std
#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_H */
#endif /* __SGI_STL_INTERNAL_ITERATOR_BASE_TYPES_H */
// Local Variables:
......
......@@ -31,7 +31,7 @@
#ifndef __SGI_STL_INTERNAL_LIST_H
#define __SGI_STL_INTERNAL_LIST_H
#include <bits/concept_checks.h>
#include <bits/concept_check.h>
namespace std
{
......@@ -198,10 +198,10 @@ _List_base<_Tp,_Alloc>::clear()
}
template <class _Tp, class _Alloc = allocator<_Tp> >
class list : protected _List_base<_Tp, _Alloc> {
// requirements:
__STL_CLASS_REQUIRES(_Tp, _Assignable);
class list : protected _List_base<_Tp, _Alloc>
{
// concept requirements
glibcpp_class_requires(_Tp, SGIAssignableConcept);
typedef _List_base<_Tp, _Alloc> _Base;
protected:
......
......@@ -31,23 +31,21 @@
#ifndef _CPP_BITS_STL_MAP_H
#define _CPP_BITS_STL_MAP_H 1
#include <bits/concept_checks.h>
#include <bits/concept_check.h>
namespace std
{
template <class _Key, class _Tp, class _Compare = less<_Key>,
class _Alloc = allocator<pair<const _Key, _Tp> > >
class map {
public:
// requirements:
__STL_CLASS_REQUIRES(_Tp, _Assignable);
__STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Key, _Key);
// typedefs:
class map
{
// concept requirements
glibcpp_class_requires(_Tp, SGIAssignableConcept);
glibcpp_class_requires4(_Compare, bool, _Key, _Key, BinaryFunctionConcept);
public:
// typedefs:
typedef _Key key_type;
typedef _Tp data_type;
typedef _Tp mapped_type;
......
......@@ -31,7 +31,7 @@
#ifndef __SGI_STL_INTERNAL_MULTIMAP_H
#define __SGI_STL_INTERNAL_MULTIMAP_H
#include <bits/concept_checks.h>
#include <bits/concept_check.h>
namespace std
{
......@@ -52,11 +52,11 @@ inline bool operator<(const multimap<_Key,_Tp,_Compare,_Alloc>& __x,
const multimap<_Key,_Tp,_Compare,_Alloc>& __y);
template <class _Key, class _Tp, class _Compare, class _Alloc>
class multimap {
// requirements:
__STL_CLASS_REQUIRES(_Tp, _Assignable);
__STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Key, _Key);
class multimap
{
// concept requirements
glibcpp_class_requires(_Tp, SGIAssignableConcept);
glibcpp_class_requires4(_Compare, bool, _Key, _Key, BinaryFunctionConcept);
public:
......
......@@ -31,7 +31,7 @@
#ifndef __SGI_STL_INTERNAL_MULTISET_H
#define __SGI_STL_INTERNAL_MULTISET_H
#include <bits/concept_checks.h>
#include <bits/concept_check.h>
namespace std
{
......@@ -51,11 +51,11 @@ inline bool operator<(const multiset<_Key,_Compare,_Alloc>& __x,
const multiset<_Key,_Compare,_Alloc>& __y);
template <class _Key, class _Compare, class _Alloc>
class multiset {
// requirements:
__STL_CLASS_REQUIRES(_Key, _Assignable);
__STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Key, _Key);
class multiset
{
// concept requirements
glibcpp_class_requires(_Key, SGIAssignableConcept);
glibcpp_class_requires4(_Compare, bool, _Key, _Key, BinaryFunctionConcept);
public:
......
......@@ -38,7 +38,9 @@ namespace std
template <class _InputIterator, class _Tp>
_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
{
__STL_REQUIRES(_InputIterator, _InputIterator);
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIterator>);
for ( ; __first != __last; ++__first)
__init = __init + *__first;
return __init;
......@@ -48,7 +50,9 @@ template <class _InputIterator, class _Tp, class _BinaryOperation>
_Tp accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
_BinaryOperation __binary_op)
{
__STL_REQUIRES(_InputIterator, _InputIterator);
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIterator>);
for ( ; __first != __last; ++__first)
__init = __binary_op(__init, *__first);
return __init;
......@@ -58,8 +62,10 @@ template <class _InputIterator1, class _InputIterator2, class _Tp>
_Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
_InputIterator2 __first2, _Tp __init)
{
__STL_REQUIRES(_InputIterator2, _InputIterator);
__STL_REQUIRES(_InputIterator2, _InputIterator);
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIterator1>);
glibcpp_function_requires(InputIteratorConcept<_InputIterator2>);
for ( ; __first1 != __last1; ++__first1, ++__first2)
__init = __init + (*__first1 * *__first2);
return __init;
......@@ -72,8 +78,10 @@ _Tp inner_product(_InputIterator1 __first1, _InputIterator1 __last1,
_BinaryOperation1 __binary_op1,
_BinaryOperation2 __binary_op2)
{
__STL_REQUIRES(_InputIterator2, _InputIterator);
__STL_REQUIRES(_InputIterator2, _InputIterator);
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIterator1>);
glibcpp_function_requires(InputIteratorConcept<_InputIterator2>);
for ( ; __first1 != __last1; ++__first1, ++__first2)
__init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
return __init;
......@@ -97,11 +105,14 @@ _OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result)
{
__STL_REQUIRES(_InputIterator, _InputIterator);
__STL_REQUIRES(_OutputIterator, _OutputIterator);
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIterator>);
glibcpp_function_requires(OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_InputIterator>::value_type>);
if (__first == __last) return __result;
*__result = *__first;
return __partial_sum(__first, __last, __result, __VALUE_TYPE(__first));
return __partial_sum(__first, __last, __result, __value_type(__first));
}
template <class _InputIterator, class _OutputIterator, class _Tp,
......@@ -123,11 +134,14 @@ _OutputIterator
partial_sum(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOperation __binary_op)
{
__STL_REQUIRES(_InputIterator, _InputIterator);
__STL_REQUIRES(_OutputIterator, _OutputIterator);
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIterator>);
glibcpp_function_requires(OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_InputIterator>::value_type>);
if (__first == __last) return __result;
*__result = *__first;
return __partial_sum(__first, __last, __result, __VALUE_TYPE(__first),
return __partial_sum(__first, __last, __result, __value_type(__first),
__binary_op);
}
......@@ -150,12 +164,15 @@ _OutputIterator
adjacent_difference(_InputIterator __first,
_InputIterator __last, _OutputIterator __result)
{
__STL_REQUIRES(_InputIterator, _InputIterator);
__STL_REQUIRES(_OutputIterator, _OutputIterator);
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIterator>);
glibcpp_function_requires(OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_InputIterator>::value_type>);
if (__first == __last) return __result;
*__result = *__first;
return __adjacent_difference(__first, __last, __result,
__VALUE_TYPE(__first));
__value_type(__first));
}
template <class _InputIterator, class _OutputIterator, class _Tp,
......@@ -178,12 +195,15 @@ _OutputIterator
adjacent_difference(_InputIterator __first, _InputIterator __last,
_OutputIterator __result, _BinaryOperation __binary_op)
{
__STL_REQUIRES(_InputIterator, _InputIterator);
__STL_REQUIRES(_OutputIterator, _OutputIterator);
// concept requirements
glibcpp_function_requires(InputIteratorConcept<_InputIterator>);
glibcpp_function_requires(OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_InputIterator>::value_type>);
if (__first == __last) return __result;
*__result = *__first;
return __adjacent_difference(__first, __last, __result,
__VALUE_TYPE(__first),
__value_type(__first),
__binary_op);
}
......@@ -241,8 +261,11 @@ template <class _ForwardIter, class _Tp>
void
iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)
{
__STL_REQUIRES(_ForwardIter, _Mutable_ForwardIterator);
__STL_CONVERTIBLE(_Tp, typename iterator_traits<_ForwardIter>::value_type);
// concept requirements
glibcpp_function_requires(Mutable_ForwardIteratorConcept<_ForwardIter>);
glibcpp_function_requires(ConvertibleConcept<_Tp,
typename iterator_traits<_ForwardIter>::value_type>);
while (__first != __last)
*__first++ = __value++;
}
......
......@@ -31,7 +31,7 @@
#ifndef __SGI_STL_INTERNAL_QUEUE_H
#define __SGI_STL_INTERNAL_QUEUE_H
#include <bits/sequence_concepts.h>
#include <bits/concept_check.h>
namespace std
{
......@@ -50,16 +50,14 @@ inline bool operator<(const queue<_Tp, _Seq>&, const queue<_Tp, _Seq>&);
template <class _Tp, class _Sequence>
class queue {
// requirements:
__STL_CLASS_REQUIRES(_Tp, _Assignable);
__STL_CLASS_REQUIRES(_Sequence, _FrontInsertionSequence);
__STL_CLASS_REQUIRES(_Sequence, _BackInsertionSequence);
class queue
{
// concept requirements
glibcpp_class_requires(_Tp, SGIAssignableConcept);
glibcpp_class_requires(_Sequence, FrontInsertionSequenceConcept);
glibcpp_class_requires(_Sequence, BackInsertionSequenceConcept);
typedef typename _Sequence::value_type _Sequence_value_type;
__STL_CLASS_REQUIRES_SAME_TYPE(_Tp, _Sequence_value_type);
glibcpp_class_requires2(_Tp, _Sequence_value_type, SameTypeConcept);
template <class _Tp1, class _Seq1>
friend bool operator== (const queue<_Tp1, _Seq1>&,
......@@ -135,17 +133,17 @@ operator>=(const queue<_Tp, _Sequence>& __x, const queue<_Tp, _Sequence>& __y)
template <class _Tp,
class _Sequence = vector<_Tp>,
class _Compare = less<typename _Sequence::value_type> >
class priority_queue {
public:
// requirements:
__STL_CLASS_REQUIRES(_Tp, _Assignable);
__STL_CLASS_REQUIRES(_Sequence, _Sequence);
__STL_CLASS_REQUIRES(_Sequence, _RandomAccessContainer);
class priority_queue
{
// concept requirements
glibcpp_class_requires(_Tp, SGIAssignableConcept);
glibcpp_class_requires(_Sequence, SequenceConcept);
glibcpp_class_requires(_Sequence, RandomAccessContainerConcept);
typedef typename _Sequence::value_type _Sequence_value_type;
__STL_CLASS_REQUIRES_SAME_TYPE(_Tp, _Sequence_value_type);
__STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Tp, _Tp);
glibcpp_class_requires2(_Tp, _Sequence_value_type, SameTypeConcept);
glibcpp_class_requires4(_Compare, bool, _Tp, _Tp, BinaryFunctionConcept);
public:
typedef typename _Sequence::value_type value_type;
typedef typename _Sequence::size_type size_type;
typedef _Sequence container_type;
......
......@@ -31,7 +31,7 @@
#ifndef __SGI_STL_INTERNAL_SET_H
#define __SGI_STL_INTERNAL_SET_H
#include <bits/concept_checks.h>
#include <bits/concept_check.h>
namespace std
{
......@@ -52,15 +52,14 @@ inline bool operator<(const set<_Key,_Compare,_Alloc>& __x,
template <class _Key, class _Compare, class _Alloc>
class set {
// requirements:
__STL_CLASS_REQUIRES(_Key, _Assignable);
__STL_CLASS_BINARY_FUNCTION_CHECK(_Compare, bool, _Key, _Key);
class set
{
// concept requirements
glibcpp_class_requires(_Key, SGIAssignableConcept);
glibcpp_class_requires4(_Compare, bool, _Key, _Key, BinaryFunctionConcept);
public:
// typedefs:
typedef _Key key_type;
typedef _Key value_type;
typedef _Compare key_compare;
......
......@@ -31,7 +31,7 @@
#ifndef __SGI_STL_INTERNAL_STACK_H
#define __SGI_STL_INTERNAL_STACK_H
#include <bits/sequence_concepts.h>
#include <bits/concept_check.h>
namespace std
{
......@@ -50,15 +50,13 @@ bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
template <class _Tp, class _Sequence>
class stack {
// requirements:
__STL_CLASS_REQUIRES(_Tp, _Assignable);
__STL_CLASS_REQUIRES(_Sequence, _BackInsertionSequence);
class stack
{
// concept requirements
glibcpp_class_requires(_Tp, SGIAssignableConcept);
glibcpp_class_requires(_Sequence, BackInsertionSequenceConcept);
typedef typename _Sequence::value_type _Sequence_value_type;
__STL_CLASS_REQUIRES_SAME_TYPE(_Tp, _Sequence_value_type);
glibcpp_class_requires2(_Tp, _Sequence_value_type, SameTypeConcept);
template <class _Tp1, class _Seq1>
friend bool operator== (const stack<_Tp1, _Seq1>&,
......
......@@ -80,7 +80,7 @@ inline _ForwardIter
_ForwardIter __result)
{
return __uninitialized_copy(__first, __last, __result,
__VALUE_TYPE(__result));
__value_type(__result));
}
inline char* uninitialized_copy(const char* __first, const char* __last,
......@@ -130,7 +130,7 @@ inline pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) {
return __uninitialized_copy_n(__first, __count, __result,
__ITERATOR_CATEGORY(__first));
__iterator_category(__first));
}
template <class _InputIter, class _Size, class _ForwardIter>
......@@ -138,7 +138,7 @@ inline pair<_InputIter, _ForwardIter>
uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result) {
return __uninitialized_copy_n(__first, __count, __result,
__ITERATOR_CATEGORY(__first));
__iterator_category(__first));
}
// Valid if copy construction is equivalent to assignment, and if the
......@@ -178,7 +178,7 @@ inline void uninitialized_fill(_ForwardIter __first,
_ForwardIter __last,
const _Tp& __x)
{
__uninitialized_fill(__first, __last, __x, __VALUE_TYPE(__first));
__uninitialized_fill(__first, __last, __x, __value_type(__first));
}
// Valid if copy construction is equivalent to assignment, and if the
......@@ -217,7 +217,7 @@ template <class _ForwardIter, class _Size, class _Tp>
inline _ForwardIter
uninitialized_fill_n(_ForwardIter __first, _Size __n, const _Tp& __x)
{
return __uninitialized_fill_n(__first, __n, __x, __VALUE_TYPE(__first));
return __uninitialized_fill_n(__first, __n, __x, __value_type(__first));
}
// Extensions: __uninitialized_copy_copy, __uninitialized_copy_fill,
......
......@@ -31,8 +31,9 @@
#ifndef __SGI_STL_INTERNAL_VECTOR_H
#define __SGI_STL_INTERNAL_VECTOR_H
#include <bits/stl_iterator_base_funcs.h>
#include <bits/functexcept.h>
#include <bits/concept_checks.h>
#include <bits/concept_check.h>
namespace std
{
......@@ -116,9 +117,8 @@ struct _Vector_base
template <class _Tp, class _Alloc = allocator<_Tp> >
class vector : protected _Vector_base<_Tp, _Alloc>
{
// requirements:
__STL_CLASS_REQUIRES(_Tp, _Assignable);
// concept requirements
glibcpp_class_requires(_Tp, SGIAssignableConcept);
private:
typedef _Vector_base<_Tp, _Alloc> _Base;
......@@ -223,7 +223,7 @@ public:
template <class _InputIterator>
void _M_initialize_aux(_InputIterator __first, _InputIterator __last,
__false_type) {
_M_range_initialize(__first, __last, __ITERATOR_CATEGORY(__first));
_M_range_initialize(__first, __last, __iterator_category(__first));
}
~vector() { destroy(_M_start, _M_finish); }
......@@ -261,7 +261,7 @@ public:
template <class _InputIter>
void _M_assign_dispatch(_InputIter __first, _InputIter __last, __false_type)
{ _M_assign_aux(__first, __last, __ITERATOR_CATEGORY(__first)); }
{ _M_assign_aux(__first, __last, __iterator_category(__first)); }
template <class _InputIterator>
void _M_assign_aux(_InputIterator __first, _InputIterator __last,
......@@ -334,7 +334,7 @@ public:
void _M_insert_dispatch(iterator __pos,
_InputIterator __first, _InputIterator __last,
__false_type) {
_M_range_insert(__pos, __first, __last, __ITERATOR_CATEGORY(__first));
_M_range_insert(__pos, __first, __last, __iterator_category(__first));
}
void insert (iterator __pos, size_type __n, const _Tp& __x)
......
......@@ -32,6 +32,7 @@
#define __SGI_STL_INTERNAL_HASH_MAP_H
#include <ext/stl_hashtable.h>
#include <bits/concept_check.h>
namespace std
{
......@@ -121,8 +122,6 @@ public:
friend bool operator== (const hash_map<_K1, _T1, _HF, _EqK, _Al>&,
const hash_map<_K1, _T1, _HF, _EqK, _Al>&);
#include <bits/concept_checks.h>
iterator begin() { return _M_ht.begin(); }
iterator end() { return _M_ht.end(); }
const_iterator begin() const { return _M_ht.begin(); }
......@@ -204,11 +203,11 @@ operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
template <class _Key, class _Tp, class _HashFcn, class _EqualKey, class _Alloc>
class hash_multimap
{
// requirements:
__STL_CLASS_REQUIRES(_Key, _Assignable);
__STL_CLASS_REQUIRES(_Tp, _Assignable);
__STL_CLASS_UNARY_FUNCTION_CHECK(_HashFcn, size_t, _Key);
__STL_CLASS_BINARY_FUNCTION_CHECK(_EqualKey, bool, _Key, _Key);
// concept requirements
glibcpp_class_requires(_Key, SGIAssignableConcept);
glibcpp_class_requires(_Tp, SGIAssignableConcept);
glibcpp_class_requires3(_HashFcn, size_t, _Key, UnaryFunctionConcept);
glibcpp_class_requires3(_EqualKey, _Key, _Key, BinaryPredicateConcept);
private:
typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn,
......
......@@ -32,8 +32,7 @@
#define __SGI_STL_INTERNAL_HASH_SET_H
#include <ext/stl_hashtable.h>
#include <bits/concept_checks.h>
#include <bits/concept_check.h>
namespace std
{
......@@ -54,11 +53,10 @@ operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_set
{
// requirements:
__STL_CLASS_REQUIRES(_Value, _Assignable);
__STL_CLASS_UNARY_FUNCTION_CHECK(_HashFcn, size_t, _Value);
__STL_CLASS_BINARY_FUNCTION_CHECK(_EqualKey, bool, _Value, _Value);
// concept requirements
glibcpp_class_requires(_Value, SGIAssignableConcept);
glibcpp_class_requires3(_HashFcn, size_t, _Value, UnaryFunctionConcept);
glibcpp_class_requires3(_EqualKey, _Value, _Value, BinaryPredicateConcept);
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
......@@ -206,11 +204,10 @@ operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
class hash_multiset
{
// requirements:
__STL_CLASS_REQUIRES(_Value, _Assignable);
__STL_CLASS_UNARY_FUNCTION_CHECK(_HashFcn, size_t, _Value);
__STL_CLASS_BINARY_FUNCTION_CHECK(_EqualKey, bool, _Value, _Value);
// concept requirements
glibcpp_class_requires(_Value, SGIAssignableConcept);
glibcpp_class_requires3(_HashFcn, size_t, _Value, UnaryFunctionConcept);
glibcpp_class_requires3(_EqualKey, _Value, _Value, BinaryPredicateConcept);
private:
typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
......
......@@ -19,7 +19,7 @@
#ifndef __SGI_STL_INTERNAL_SLIST_H
#define __SGI_STL_INTERNAL_SLIST_H
#include <bits/concept_checks.h>
#include <bits/concept_check.h>
namespace std
{
......@@ -257,9 +257,8 @@ _Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first,
template <class _Tp, class _Alloc = allocator<_Tp> >
class slist : private _Slist_base<_Tp,_Alloc>
{
// requirements:
__STL_CLASS_REQUIRES(_Tp, _Assignable);
// concept requirements
glibcpp_class_requires(_Tp, SGIAssignableConcept);
private:
typedef _Slist_base<_Tp,_Alloc> _Base;
......
......@@ -353,13 +353,13 @@ public:
template <class _InputIterator>
void insert_unique(_InputIterator __f, _InputIterator __l)
{
insert_unique(__f, __l, __ITERATOR_CATEGORY(__f));
insert_unique(__f, __l, __iterator_category(__f));
}
template <class _InputIterator>
void insert_equal(_InputIterator __f, _InputIterator __l)
{
insert_equal(__f, __l, __ITERATOR_CATEGORY(__f));
insert_equal(__f, __l, __iterator_category(__f));
}
template <class _InputIterator>
......
......@@ -111,7 +111,7 @@ xcompiling = @xcompiling@
AUTOMAKE_OPTIONS = 1.3 cygnus
mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
@GLIBCPP_BUILD_LIBIO_TRUE@noinst_LTLIBRARIES = libio.la
@GLIBCPP_BUILD_LIBIO_TRUE@noinst_LTLIBRARIES = @GLIBCPP_BUILD_LIBIO_TRUE@libio.la
@GLIBCPP_BUILD_LIBIO_FALSE@noinst_LTLIBRARIES =
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
......@@ -123,14 +123,21 @@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
INCLUDES = -nostdinc++ -I$(top_builddir)/include -I$(GLIBCPP_INCLUDE_DIR) $(LIBIO_INCLUDES) $(TOPLEVEL_INCLUDES)
INCLUDES = \
-nostdinc++ \
-I$(top_builddir)/include -I$(GLIBCPP_INCLUDE_DIR) \
$(LIBIO_INCLUDES) $(TOPLEVEL_INCLUDES)
libio_headers = libio.h libioP.h iolibio.h
libio_headers = \
libio.h libioP.h iolibio.h
@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = filedoalloc.c genops.c fileops.c stdfiles.c c_codecvt.c iofclose.c iofopen.c
@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = @GLIBCPP_NEED_LIBIO_TRUE@\
@GLIBCPP_NEED_LIBIO_TRUE@ filedoalloc.c genops.c fileops.c stdfiles.c c_codecvt.c \
@GLIBCPP_NEED_LIBIO_TRUE@ iofclose.c iofopen.c
@GLIBCPP_NEED_LIBIO_FALSE@LIBIO_SRCS =
@GLIBCPP_NEED_WLIBIO_TRUE@LIBIO_WSRCS = wfiledoalloc.c wfileops.c wgenops.c iofwide.c
@GLIBCPP_NEED_WLIBIO_TRUE@LIBIO_WSRCS = @GLIBCPP_NEED_WLIBIO_TRUE@\
@GLIBCPP_NEED_WLIBIO_TRUE@ wfiledoalloc.c wfileops.c wgenops.c iofwide.c
@GLIBCPP_NEED_WLIBIO_FALSE@LIBIO_WSRCS =
EXTRA_DIST = iostreamP.h
......
......@@ -114,18 +114,24 @@ mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
noinst_LTLIBRARIES = libmath.la
EXTRA_LONG_DOUBLE_yes = hypotl.c signbitl.c
EXTRA_LONG_DOUBLE_yes = \
hypotl.c signbitl.c
EXTRA_DIST = hypot.c hypotf.c atan2f.c expf.c $(EXTRA_LONG_DOUBLE_yes)
EXTRA_DIST = \
hypot.c hypotf.c atan2f.c expf.c \
$(EXTRA_LONG_DOUBLE_yes)
libmath_la_LIBADD = @LIBMATHOBJS@ $(EXTRA_LONG_DOUBLE_$(USE_COMPLEX_LONG_DOUBLE))
libmath_la_LIBADD = \
@LIBMATHOBJS@ \
$(EXTRA_LONG_DOUBLE_$(USE_COMPLEX_LONG_DOUBLE))
libmath_la_DEPENDENCIES = $(libmath_la_LIBADD)
libmath_la_SOURCES = signbit.c signbitf.c
libmath_la_SOURCES = \
signbit.c signbitf.c
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
......@@ -139,7 +145,9 @@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
CSHADOW_INCLUDES = @CSHADOW_INCLUDES@
INCLUDES = -I$(GLIBCPP_INCLUDE_DIR) -I$(top_builddir)/include $(TOPLEVEL_INCLUDES)
INCLUDES = \
-I$(GLIBCPP_INCLUDE_DIR) -I$(top_builddir)/include \
$(TOPLEVEL_INCLUDES)
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
......
......@@ -129,11 +129,13 @@ OPTIMIZE_CXXFLAGS = @OPTIMIZE_CXXFLAGS@
# These bits are all figured out from configure. Look in acinclude.m4
# or configure.in to see how they are set. See GLIBCPP_EXPORT_FLAGS
# NB: DEBUGFLAGS have to be at the end so that -O2 can be overridden.
CONFIG_CXXFLAGS = @EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@
CONFIG_CXXFLAGS = \
@EXTRA_CXX_FLAGS@ @SECTION_FLAGS@ @CSHADOW_FLAGS@ @DEBUG_FLAGS@
# Warning flags to use.
WARN_CXXFLAGS = @WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
WARN_CXXFLAGS = \
@WARN_FLAGS@ $(WERROR) -fdiagnostics-show-location=once
# Use common includes from acinclude.m4/GLIBCPP_EXPORT_INCLUDES
......@@ -145,13 +147,38 @@ LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
LIBIO_INCLUDES = @LIBIO_INCLUDES@
TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
INCLUDES = -I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include -I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include $(LIBSUPCXX_INCLUDES)
headers = exception new typeinfo cxxabi.h exception_defines.h
sources = del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc eh_alloc.cc eh_aux_runtime.cc eh_catch.cc eh_exception.cc eh_globals.cc eh_personality.cc eh_terminate.cc eh_throw.cc new_handler.cc new_op.cc new_opnt.cc new_opv.cc new_opvnt.cc pure.cc tinfo.cc tinfo2.cc vec.cc
INCLUDES = \
-I$(toplevel_srcdir)/gcc -I$(toplevel_srcdir)/include \
-I$(GLIBCPP_INCLUDE_DIR) $(CSTD_INCLUDES) -I$(top_builddir)/include \
$(LIBSUPCXX_INCLUDES)
headers = \
exception new typeinfo cxxabi.h exception_defines.h
sources = \
del_op.cc \
del_opnt.cc \
del_opv.cc \
del_opvnt.cc \
eh_alloc.cc \
eh_aux_runtime.cc \
eh_catch.cc \
eh_exception.cc \
eh_globals.cc \
eh_personality.cc \
eh_terminate.cc \
eh_throw.cc \
new_handler.cc \
new_op.cc \
new_opnt.cc \
new_opv.cc \
new_opvnt.cc \
pure.cc \
tinfo.cc \
tinfo2.cc \
vec.cc
libsupc___la_SOURCES = $(sources)
......@@ -167,7 +194,12 @@ LIBSUPCXX_CXXFLAGS = -prefer-pic
# set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion call for it. (ie, --enable-debug)
AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS)
AM_CXXFLAGS = \
-fno-implicit-templates \
$(LIBSUPCXX_CXXFLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
$(CONFIG_CXXFLAGS)
# libstdc++ libtool notes
......@@ -191,7 +223,9 @@ AM_CXXFLAGS = -fno-implicit-templates $(LIBSUPCXX_CXXFLAGS) $(WARN_CXXFLAGS)
#
# We have to put --tag disable-shared after --tag CXX lest things
# CXX undo the affect of disable-shared.
LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared --mode=compile $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared \
--mode=compile $(CXX) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $(AM_CXXFLAGS)
# 3) We'd have a problem when building the shared libstdc++ object if
......@@ -200,7 +234,9 @@ LTCXXCOMPILE = $(LIBTOOL) --tag CXX --tag disable-shared --mode=c
# course is problematic at this point. So, we get the top-level
# directory to configure libstdc++-v3 to use gcc as the C++
# compilation driver.
CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared --mode=link $(CXX) @OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
CXXLINK = $(LIBTOOL) --tag CXX --tag disable-shared \
--mode=link $(CXX) \
@OPT_LDFLAGS@ @SECTION_LDFLAGS@ $(AM_CXXFLAGS) $(LDFLAGS) -o $@
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
......
......@@ -21,7 +21,7 @@
## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
## USA.
## $Id: Makefile.am,v 1.79 2001/03/28 01:19:42 aoliva Exp $
## $Id: Makefile.am,v 1.80 2001/03/31 20:15:43 bkoz Exp $
AUTOMAKE_OPTIONS = 1.3 gnits
MAINT_CHARSET = latin1
......@@ -80,7 +80,8 @@ base_headers = \
bits/streambuf.tcc bits/basic_file.h \
bits/locale_facets.h bits/locale_facets.tcc bits/localefwd.h \
bits/stl_pthread_alloc.h bits/pthread_allocimpl.h \
bits/stl_threads.h bits/stl_iterator_base.h \
bits/stl_threads.h \
bits/stl_iterator_base_types.h bits/stl_iterator_base_funcs.h \
bits/std_bitset.h bits/std_deque.h bits/std_functional.h \
bits/std_iterator.h bits/std_list.h \
bits/std_map.h bits/std_memory.h bits/std_numeric.h \
......@@ -91,12 +92,11 @@ base_headers = \
bits/stl_heap.h bits/stl_iterator.h bits/stl_list.h bits/stl_map.h \
bits/stl_multimap.h bits/stl_multiset.h bits/stl_numeric.h \
bits/stl_pair.h bits/stl_queue.h bits/stl_raw_storage_iter.h \
bits/stl_relops.h bits/stl_set.h \
bits/stl_stack.h bits/stl_tempbuf.h \
bits/stl_relops.h bits/stl_set.h bits/stl_stack.h bits/stl_tempbuf.h \
bits/stl_tree.h bits/stl_uninitialized.h bits/stl_vector.h \
bits/stl_bvector.h bits/type_traits.h bits/std_algorithm.h \
bits/concept_checks.h bits/container_concepts.h \
bits/sequence_concepts.h bits/stl_construct.h
bits/stl_construct.h bits/boost_concept_check.h bits/concept_check.h
backward_headers = \
backward/complex.h backward/iomanip.h backward/istream.h \
......@@ -299,8 +299,12 @@ tmp-libstdc++.INC: Makefile
# set this option because CONFIG_CXXFLAGS has to be after
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion call for it. (ie, --enable-debug)
#
# The no-implicit-templates flag will generate unresolved references to
# the concept-checking symbols. So we must disable the checks while
# actually building the library.
AM_CXXFLAGS = \
-fno-implicit-templates \
-fno-implicit-templates -D_GLIBCPP_NO_CONCEPT_CHECKS \
$(LIBSUPCXX_CXXFLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
......
......@@ -118,10 +118,14 @@ AUTOMAKE_OPTIONS = foreign dejagnu no-installinfo
DEJATOOL = libstdc++
EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then echo $(top_builddir)/../expect/expect ; else echo expect ; fi`
EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
echo $(top_builddir)/../expect/expect ; \
else echo expect ; fi`
RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then echo $(top_srcdir)/../dejagnu/runtest ; else echo runtest; fi`
RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
echo $(top_srcdir)/../dejagnu/runtest ; \
else echo runtest; fi`
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = ../config.h
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment