ACCU's excellent site, with many good book reviews.
A suggestion for an addition to the STL
A talk on C++ and the STL from Cambridge. Bjarne Stroustrup's home page SGI has a public-domain version of the library with excellent documentation, available at SGI public-domain library and reference.
There is a port of the SGI library by Boris Fomitchev, which works on many current compilers; this is probably the best version to use.
HP provided the first public domain version in 95?. It is still available at ??
ObjectSpace apparently no longer provides a port of STL .
XTL: as of 25 Jan 98, unable to find XTL on the web. I saw it some time in late 97, as a commercial version of STL with extensions.
Nikki Locke has a web page at Trumphurst that lists lists a very large number of C++ libraries; it is based on the comp.lang.c++ library list.
Reserved words
Traits
I think traits are a very important notion that is not yet very well
understood by most people in the C++ community.
Here is my take on what traits should be and what they are currently used for.
OOP | Generic programming | ||
Class | Concept | ||
Inheritance | Modeling a concept | ADT | Trait |
There are excellent descriptions of concepts and modeling a concept at Stepanov's web site at SGI.
That is, both "concept classes" (see below) and traits are declarations of a concept (a set of requirements for types, similar to an abstract data type, but traits are designed for the case where there is no inheritance, necessarily). They are similar to java's notion of interfaces, but I don't know java well enough to tell how closely they resemble each other.
Currently, traits aren't quite used like this. Instead, they are used
to provide a subset of the requirements of the concept. For example,
the type
Iterator traits and function traits have recently been added to the
standard, but there are
still some things that are missing, IMHO.
There is nothing in the trait that relates to complexity, which could be
very useful for function traits. Classes like unary_function at the
moment do not define the operator(), so they cannot be used a s a base
class. Could traits be defined in such a way that inheriting from the
"concept class" (for lack of a better name; I mean the class like
unary_function) would cause a compile-time error if the class did not
satisfy all the requirements?
There are excellent descriptions of implementations of smart pointers,
reference counting, proxies, etc., with clear explanations of the
ramifications of the choices you will have to make. Lots on
exception-handling. Not much on generic programming.
[To be continued]
Jak
C++
fct1_traits
provides the typedefs that are
necessary for classes that model 1-arg functions. They
define things like the result type, which can then be used by classes
such as Compose
(as suggested by Koenig and Moo).When
defining a unary function, it is recommended that you inherit from
the class unary_function
, for which fct1_traits are
defined.
So, I guess in reality, it is a combination of the class
unary_function
and the
fct1_traits
that does
the job of the ADT.
C++ books
Here are some C++ books that I have looked at in some depth. They
are accompanied by my opinions; if you disagree strongly I would be
interested in discussing the book by email, though I am very slow at
responding to mail...
Tutorials
Advanced C++
For those people comfortable with the language and with
object-oriented programming, there are a number of good books
available.
The URL for this document is
http://www.jak.org/c++/home.html
Created: Friday 18 July 1997