Modified: incubator/stdcxx/trunk/doc/stdlibug/1-1.html URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/doc/stdlibug/1-1.html?rev=370343&r1=370342&r2=370343&view=diff ============================================================================== --- incubator/stdcxx/trunk/doc/stdlibug/1-1.html (original) +++ incubator/stdcxx/trunk/doc/stdlibug/1-1.html Wed Jan 18 17:30:36 2006 @@ -3,12 +3,12 @@
Congratulations on choosing the Standard C++ Library Module, the Rogue Wave implementation of the Standard C++ Library. This module is part of SourcePro Core, an extensive set of fundamental C++ components. You can use this product with confidence: it is based on the final standard for the C++ language and library ratified in 1998 by the American National Standards Institute (ANSI) and the International Standards Organization (ISO).
+Congratulations on choosing the C++ Standard Library Module, the Rogue Wave implementation of the C++ Standard Library. This module is part of SourcePro Core, an extensive set of fundamental C++ components. You can use this product with confidence: it is based on the final standard for the C++ language and library ratified in 1998 by the American National Standards Institute (ANSI) and the International Standards Organization (ISO).
Since its development by Dr. Bjarne Stroustrup in the 1980s, the C++ language has been widely used by professional programmers for the world's big, complex applications in telecommunications, finance, business, embedded systems, and computer-aided design. The final standardization of the C++ library now makes it easier to learn C++ and to use it across a wide variety of platforms.
-Standardization improves portability and stability. You can build reliable applications faster, and maintain them with less cost and effort, using the Standard C++ Library.
+Standardization improves portability and stability. You can build reliable applications faster, and maintain them with less cost and effort, using the C++ Standard Library.
The Standard C++ Library is a large and comprehensive collection of classes and functions for fine-grained, low-level programming. Within this library, you will find the following components:
+The C++ Standard Library is a large and comprehensive collection of classes and functions for fine-grained, low-level programming. Within this library, you will find the following components:
The large set of data structures and algorithms formerly known as the Standard Template Library (STL)
Exception handling features
The STL portion of the Standard C++ Library is not object-oriented. If you are accustomed to the benefits of object-oriented programming, their absence may necessitate some adjustment. Encapsulation of data and functionality in objects is a hallmark of object-oriented programming. In the Standard C++ Library, however, the data structures are separate from the algorithms you use to manipulate them.
+The STL portion of the C++ Standard Library is not object-oriented. If you are accustomed to the benefits of object-oriented programming, their absence may necessitate some adjustment. Encapsulation of data and functionality in objects is a hallmark of object-oriented programming. In the C++ Standard Library, however, the data structures are separate from the algorithms you use to manipulate them.
This feature can provide a number of advantages, such as smaller source code, and the flexibility of using algorithms with C++ pointers and arrays as well as conventional objects. It can also lead to more efficient coding and faster execution, since it creates a direct, nuts-and-bolts approach to solving problems.
-The main disadvantage of using the Standard C++ Library directly is increased risk of error. For example, the library's iterators must not be mismatched or invalidated, and iterators in multithreaded environments should be wrapped before being shared among threads. The templates can cause less precise diagnostics, and code that grows unexpectedly large. Experience with the library and your own compiler will help diminish these problems.
+The main disadvantage of using the C++ Standard Library directly is increased risk of error. For example, the library's iterators must not be mismatched or invalidated, and iterators in multithreaded environments should be wrapped before being shared among threads. The templates can cause less precise diagnostics, and code that grows unexpectedly large. Experience with the library and your own compiler will help diminish these problems.
This Rogue Wave implementation of the Standard C++ Library is certified for use with the Essential Tools Module of SourcePro Core, which encapsulates the Standard C++ Library with an object-oriented interface. Used together, the Essential Tools and Standard C++ Library Modules are designed to provide the benefits of both low-level generic programming and object-orientation.
-The Essential Tools Module also contains features not included in the standard, such as time, date, and regular expression classes, enhanced strings, hash containers, object persistence, and virtual streams. The Essential Networking Module of SourcePro Net extends the functionality of the Essential Tools Module with classes for network programming. For some programming tasks, you may find it easier and more convenient to use the Essential Tools and Essential Networking Modules without accessing the Standard C++ Library directly.
+This Rogue Wave implementation of the C++ Standard Library is certified for use with the Essential Tools Module of SourcePro Core, which encapsulates the C++ Standard Library with an object-oriented interface. Used together, the Essential Tools and C++ Standard Library Modules are designed to provide the benefits of both low-level generic programming and object-orientation.
+The Essential Tools Module also contains features not included in the standard, such as time, date, and regular expression classes, enhanced strings, hash containers, object persistence, and virtual streams. The Essential Networking Module of SourcePro Net extends the functionality of the Essential Tools Module with classes for network programming. For some programming tasks, you may find it easier and more convenient to use the Essential Tools and Essential Networking Modules without accessing the C++ Standard Library directly.
This implementation of the Standard C++ Library conforms to ISO/IEC 14882:2003 -- International Standard for Information Systems -- Programming Language C++. This release is source compatible with previous 2.x implementations.
+This implementation of the C++ Standard Library conforms to ISO/IEC 14882:2003 -- International Standard for Information Systems -- Programming Language C++. This release is source compatible with previous 2.x implementations.
1.x implementations of the library were based on ANSI's Working Paper for Draft Proposed International Standard for Information Systems -- Programming Language C++. The draft standard differs from the final standard in some areas. As a result, source written to 1.x implementations of the library will be incompatible with this implementation in these areas. See the readme file for details.
Please note that some compiler and library vendors have not yet implemented the whole range of language features defined by the ANSI/ISO standard.
-NOTE -- The Standard C++ Library is not yet fully implemented by all compilers. You may experience difficulty if you attempt to use features of the library that are unsupported by your compiler. +NOTE -- The C++ Standard Library is not yet fully implemented by all compilers. You may experience difficulty if you attempt to use features of the library that are unsupported by your compiler.
In the User's Guide, we draw your attention to places in the code where this might be a problem. If your vendor is still in the process of meeting the standard, some of the techniques demonstrated in this User's Guide may not work. We include them anyway to demonstrate the full range of capabilities of the standard C++ language. Compilers will catch up, and this guide will be more useful to you if it is as complete as possible.
Everything in the Standard C++ Library Module is contained in the std namespace. You must specify a using directive or explicitly scope any name from the library.
+Everything in the C++ Standard Library Module is contained in the std namespace. You must specify a using directive or explicitly scope any name from the library.
To use the vector class, for example, you could include one of the following using directives:
@@ -30,7 +30,7 @@ std::vector<int> v;
-NOTE -- To enhance this manual's readability, namespace scoping is usually omitted in the text. You should assume that everything in the Standard C++ Library Module is scoped in namespace std unless otherwise stated. +NOTE -- To enhance this manual's readability, namespace scoping is usually omitted in the text. You should assume that everything in the C++ Standard Library Module is scoped in namespace std unless otherwise stated.
To help you learn to use the Standard C++ Library Module quickly and effectively, Rogue Wave provides the documentation described in Table 1.
+To help you learn to use the C++ Standard Library Module quickly and effectively, Rogue Wave provides the documentation described in Table 1.
All Rogue Wave documentation is installed online when you install your product. In addition, printed copies of user's guides may be purchased from your sales representative.
For easiest access to the Rogue Wave online documentation, open the file buildspace\docs\index.html with your favorite browser, and follow the links to the documents you need.
-Online documentation for the Standard C++ Library Module is available at the locations shown in Table 1.
+Online documentation for the C++ Standard Library Module is available at the locations shown in Table 1.
Returns true if the collection is empty |
Elements of type T must be comparable to each other, either through the use of the default less-than operator, operator<(), or through a comparison function passed either as a template argument or as an optional argument on the constructor. The latter form will be illustrated in the example program provided later in this chapter. As with all the containers in the Standard C++ Library, there are several constructors. The default constructor requires either no arguments or the optional comparison function. An alternative constructor takes two iterators and initializes the values in the container from the range the iterators define. An optional third argument can be used to define the comparison function.
-The priority_queue datatype is built on top of a container class, which is the structure actually used to maintain the values in the collection. There are two containers in the Standard C++ Library that can be used to construct priority_queues: vectors or deques. By default, a priority_queue will use vector.
+Elements of type T must be comparable to each other, either through the use of the default less-than operator, operator<(), or through a comparison function passed either as a template argument or as an optional argument on the constructor. The latter form will be illustrated in the example program provided later in this chapter. As with all the containers in the C++ Standard Library, there are several constructors. The default constructor requires either no arguments or the optional comparison function. An alternative constructor takes two iterators and initializes the values in the container from the range the iterators define. An optional third argument can be used to define the comparison function.
+The priority_queue datatype is built on top of a container class, which is the structure actually used to maintain the values in the collection. There are two containers in the C++ Standard Library that can be used to construct priority_queues: vectors or deques. By default, a priority_queue will use vector.
The following illustrates the declaration of several priority_queues:
Modified: incubator/stdcxx/trunk/doc/stdlibug/11-3.html URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/doc/stdlibug/11-3.html?rev=370343&r1=370342&r2=370343&view=diff ============================================================================== --- incubator/stdcxx/trunk/doc/stdlibug/11-3.html (original) +++ incubator/stdcxx/trunk/doc/stdlibug/11-3.html Wed Jan 18 17:30:36 2006 @@ -3,7 +3,7 @@The simulation queue needs to maintain a collection of different types of events, sometimes called a heterogeneous collection. Each different form of event is represented by a subclass of class event, but not all events have the same exact type. For this reason the collection must store pointers to events, instead of the events themselves. Since the containers maintain pointers to values, not the values themselves, the programmer is responsible for managing the memory for the objects being manipulated.
-Since comparison of pointers cannot be specialized on the basis of the pointer types, we must instead define a new comparison function for pointers to events. In the Standard C++ Library we do this by defining a new structure whose sole purpose is to define the function invocation operator()() in the appropriate fashion. Since in this particular example we want to use the priority_queue to return the smallest element each time, rather than the largest, the order of the comparison is reversed, as follows:
+Since comparison of pointers cannot be specialized on the basis of the pointer types, we must instead define a new comparison function for pointers to events. In the C++ Standard Library we do this by defining a new structure whose sole purpose is to define the function invocation operator()() in the appropriate fashion. Since in this particular example we want to use the priority_queue to return the smallest element each time, rather than the largest, the order of the comparison is reversed, as follows:
struct eventComparison {
Modified: incubator/stdcxx/trunk/doc/stdlibug/11.html
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/doc/stdlibug/11.html?rev=370343&r1=370342&r2=370343&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibug/11.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibug/11.html Wed Jan 18 17:30:36 2006
@@ -3,7 +3,7 @@
The Container Adaptor priority queue
-



Rogue Wave C++ Standard Library User's Guide
+



Apache C++ Standard Library User's Guide
Chapter 11: The Container Adaptor priority queue
A string is basically a sequence of characters that can be indexed. In fact, although a string is not declared as a subclass of vector, almost all the vector operators discussed in Chapter 5 can be applied to string values. Indeed, a string qualifies as a sequence container type. However, a string is also a much more abstract quantity. In addition to simple vector operators, the string datatype provides a number of useful and powerful high level operations.
-In the Standard C++ Library, a string is actually a template class, named basic_string. The template argument represents the type of character that will be held by the string container. By defining strings in this fashion, the Standard C++ Library not only provides facilities for manipulating sequences of 8-bit characters, but also for manipulating other types of character-like sequences, such as 16-bit wide characters. The datatypes string and wstring (for wide string) are simply typedefs of basic_string, defined as follows:
+In the C++ Standard Library, a string is actually a template class, named basic_string. The template argument represents the type of character that will be held by the string container. By defining strings in this fashion, the C++ Standard Library not only provides facilities for manipulating sequences of 8-bit characters, but also for manipulating other types of character-like sequences, such as 16-bit wide characters. The datatypes string and wstring (for wide string) are simply typedefs of basic_string, defined as follows:
typedef std::basic_string<char, std::char_traits<char>, Modified: incubator/stdcxx/trunk/doc/stdlibug/12-2.html URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/doc/stdlibug/12-2.html?rev=370343&r1=370342&r2=370343&view=diff ============================================================================== --- incubator/stdcxx/trunk/doc/stdlibug/12-2.html (original) +++ incubator/stdcxx/trunk/doc/stdlibug/12-2.html Wed Jan 18 17:30:36 2006 @@ -3,9 +3,9 @@string Operations -Rogue Wave C++ Standard Library User's Guide+Apache C++ Standard Library User's Guide12.2 string Operations
-In the following sections, we'll examine the Standard C++ Library operations used to create and manipulate strings.
+In the following sections, we'll examine the C++ Standard Library operations used to create and manipulate strings.
12.2.1 Declaration and Initialization of string
The simplest form of declaration for a string simply names a new variable, or names a variable along with the initial value for the string. This form was used extensively in the example graph program given in Section 9.3.2. A copy constructor also permits a string to be declared that takes its value from a previously defined string:
@@ -21,7 +21,7 @@
std::string s7(10, '\n'); // holds ten newline characters-
Finally, like all the container classes in the Standard C++ Library, a string can be initialized using a pair of iterators. The sequence denoted by the iterators must have the appropriate type of elements.
+Finally, like all the container classes in the C++ Standard Library, a string can be initialized using a pair of iterators. The sequence denoted by the iterators must have the appropriate type of elements.
string s8 (aList.begin(), aList.end());
@@ -80,7 +80,7 @@
// s2 and s3
-As with all the containers in the Standard C++ Library, the contents of two strings can be exchanged using the swap() member function:
+As with all the containers in the C++ Standard Library, the contents of two strings can be exchanged using the swap() member function:
s5.swap(s4); // exchange s4 and s5 Modified: incubator/stdcxx/trunk/doc/stdlibug/12-3.html URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/doc/stdlibug/12-3.html?rev=370343&r1=370342&r2=370343&view=diff ============================================================================== --- incubator/stdcxx/trunk/doc/stdlibug/12-3.html (original) +++ incubator/stdcxx/trunk/doc/stdlibug/12-3.html Wed Jan 18 17:30:36 2006 @@ -3,7 +3,7 @@Example Function: Split a Line into Words -Rogue Wave C++ Standard Library User's Guide+Apache C++ Standard Library User's Guide12.3 Example Function: Split a Line into Words
Modified: incubator/stdcxx/trunk/doc/stdlibug/12.html URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/doc/stdlibug/12.html?rev=370343&r1=370342&r2=370343&view=diff ============================================================================== --- incubator/stdcxx/trunk/doc/stdlibug/12.html (original) +++ incubator/stdcxx/trunk/doc/stdlibug/12.html Wed Jan 18 17:30:36 2006 @@ -3,7 +3,7 @@string -Rogue Wave C++ Standard Library User's Guide+Apache C++ Standard Library User's GuideChapter 12: string
In this chapter and in Chapter 14 we examine and illustrate each of the generic algorithms provided by the Standard C++ Library. The names and a short description of each of the algorithms in this chapter are given in Table 19. We have divided the algorithms into several categories, based on how they are typically used. This division differs from the categories used in the Standard C++ Library definition, which is based upon whether or not the algorithms modify their arguments.
-In this chapter and in Chapter 14 we examine and illustrate each of the generic algorithms provided by the C++ Standard Library. The names and a short description of each of the algorithms in this chapter are given in Table 19. We have divided the algorithms into several categories, based on how they are typically used. This division differs from the categories used in the C++ Standard Library definition, which is based upon whether or not the algorithms modify their arguments.
+| Algorithm | Purpose
Modified: incubator/stdcxx/trunk/doc/stdlibug/13-2.html
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/doc/stdlibug/13-2.html?rev=370343&r1=370342&r2=370343&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibug/13-2.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibug/13-2.html Wed Jan 18 17:30:36 2006
@@ -3,11 +3,11 @@
Rogue Wave C++ Standard Library User's Guide
+Apache C++ Standard Library User's Guide
13.2 Initialization Algorithms-The first set of algorithms we cover are used chiefly, although not exclusively, to initialize a newly created sequence with certain values. The Standard C++ Library provides several initialization algorithms. The initialization algorithms all overwrite every element in a container. The difference between the algorithms is the source for the values used in initialization. The std::fill() algorithm repeats a single value, the std::copy() algorithm reads values from a second container, and the std::generate() algorithm invokes a function for each new value. In our discussion we provide examples of how to apply these algorithms, and suggest how to choose one algorithm over another. +The first set of algorithms we cover are used chiefly, although not exclusively, to initialize a newly created sequence with certain values. The C++ Standard Library provides several initialization algorithms. The initialization algorithms all overwrite every element in a container. The difference between the algorithms is the source for the values used in initialization. The std::fill() algorithm repeats a single value, the std::copy() algorithm reads values from a second container, and the std::generate() algorithm invokes a function for each new value. In our discussion we provide examples of how to apply these algorithms, and suggest how to choose one algorithm over another. @@ -59,10 +59,10 @@ By applying an insert iterator (Section 2.4), example 2 illustrates how the std::fill_n() algorithm can be used to initialize a variable length container, such as a list. In this case the list initially contains five elements, all holding the text "nothing". The call on std::fill_n() then inserts ten instances of the string "empty". The resulting list contains fifteen elements. Examples 3 and 4 illustrate how std::fill() can be used to change the values in an existing container. In example 3 each of the fifteen elements in the list created in example 2 is replaced by the string "full". Example 4 overwrites only a portion of a list. Using the generic algorithm std::generate() and the function object iotaGen (see Section 3.2 and Section 13.2.3), a vector is initialized to the values 1 2 3... 10. The std::find() algorithm (see Section 13.3.1) is used to locate the position of the element 7, saving the location in an iterator appropriate for the vector datatype. The std::fill() call then replaces all values up to, but not including, the 7 entry with the value 0. The resulting vector has six zero fields, followed by the values 7, 8, 9 and 10. -The std::fill() and std::fill_n() algorithm can be used with all the container classes contained in the Standard C++ Library, although insert iterators must be used with ordered containers, such as sets. +The std::fill() and std::fill_n() algorithm can be used with all the container classes contained in the C++ Standard Library, although insert iterators must be used with ordered containers, such as sets. 13.2.2 Copy One Sequence Into Another Sequence-The algorithms std::copy() and std::copy_backward() are versatile functions that can be used for a number of different purposes, and are probably the most commonly executed algorithms in the Standard C++ Library. The declarations for these algorithms are as follows: +The algorithms std::copy() and std::copy_backward() are versatile functions that can be used for a number of different purposes, and are probably the most commonly executed algorithms in the C++ Standard Library. The declarations for these algorithms are as follows:
namespace std {
Modified: incubator/stdcxx/trunk/doc/stdlibug/13-3.html
URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/doc/stdlibug/13-3.html?rev=370343&r1=370342&r2=370343&view=diff
==============================================================================
--- incubator/stdcxx/trunk/doc/stdlibug/13-3.html (original)
+++ incubator/stdcxx/trunk/doc/stdlibug/13-3.html Wed Jan 18 17:30:36 2006
@@ -3,7 +3,7 @@
Many of the searching algorithms have an optional argument that can specify a function for comparing elements in place of the equality operator==() for the container element type. In the descriptions of the algorithms, we write these optional arguments inside square brackets to indicate they need not be specified if the standard equality operator is acceptable. 13.3.1 Find an Element Satisfying a Condition@@ -277,7 +277,7 @@ << std::endl; } -The maximum and minimum algorithms can be used with all the datatypes provided by the Standard C++ Library. However, for the ordered datatypes set and map, the maximum or minimum values are more easily accessed as the first or last elements in the structure. +The maximum and minimum algorithms can be used with all the datatypes provided by the C++ Standard Library. However, for the ordered datatypes set and map, the maximum or minimum values are more easily accessed as the first or last elements in the structure. 13.3.7 Locate the First Mismatched Elements in Parallel SequencesThe name std::mismatch() might lead you to think this algorithm is the inverse of the std::equal() algorithm, which determines if two sequences are equal (Section 13.6.4). Instead, the std::mismatch() algorithm returns a pair of iterators that together indicate the first positions where two parallel sequences have differing elements. The structure pair is described in Section 9.1 and Section 9.2.1. Modified: incubator/stdcxx/trunk/doc/stdlibug/13-4.html URL: http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/doc/stdlibug/13-4.html?rev=370343&r1=370342&r2=370343&view=diff ============================================================================== --- incubator/stdcxx/trunk/doc/stdlibug/13-4.html (original) +++ incubator/stdcxx/trunk/doc/stdlibug/13-4.html Wed Jan 18 17:30:36 2006 @@ -3,7 +3,7 @@Rogue Wave C++ Standard Library User's Guide
+Apache C++ Standard Library User's Guide
13.4 In-Place TransformationsThe next category of algorithms that we examine is used to modify and transform sequences without moving them from their original storage locations. @@ -157,7 +157,7 @@ } -There are two forms of partition supported in the Standard C++ Library. The first, provided by the algorithm std::partition(), guarantees only that the elements are divided into two groups. The result value is an iterator that describes the final midpoint between the two groups; it is one past the end of the first group. +There are two forms of partition supported in the C++ Standard Library. The first, provided by the algorithm std::partition(), guarantees only that the elements are divided into two groups. The result value is an iterator that describes the final midpoint between the two groups; it is one past the end of the first group. In the example program, the initial vector contains the values 1 to 10 in order. The partition moves the even elements to the front, and the odd elements to the end. This results in the vector holding the values 10 2 8 4 6 5 7 3 9 1, and the midpoint iterator pointing to the element 5. |