Standard Template Library Programmer's Guide

Здесь есть возможность читать онлайн «Standard Template Library Programmer's Guide» весь текст электронной книги совершенно бесплатно (целиком полную версию без сокращений). В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Жанр: Программирование, Справочники, на английском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

Standard Template Library Programmer's Guide: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «Standard Template Library Programmer's Guide»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

This document contains reference on SGI STL implementation

Standard Template Library Programmer's Guide — читать онлайн бесплатно полную книгу (весь текст) целиком

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «Standard Template Library Programmer's Guide», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать
Notes

[1] Two different invocations of f may return different results, even if f is called with the same arguments both times. A Binary Function may refer to local state, perform I/O, and so on. The expression f(x,y) is permitted to change f 's state.

See also

Function Object overview, Generator, Unary Function, Adaptable Binary Function

Adaptable Generator

Category: functors

Component type: concept

Description

An Adaptable Generator is a Generator with a nested typedef that defines its result type. [1] This nested typedef makes it possible to use function object adaptors.

Refinement of

Generator

Associated types
Result type F::result_type The type returned when the Generator is called
Notation

FA type that is a model of Adaptable Generator

Valid expressions

None, except for those defined by Generator

Models

The STL does not include any types that are models of Adaptable Generator. An example of a user-defined Adaptable Generator is as follows.

struct counter {

typedef int result_type;

counter() : n(0) {}

result_type operator()() { return n++; }

result_type n;

};

Notes

[1] Note the implication of this: a function pointer T (*f)() is a Generator, but not an Adaptable Generator: the expression f::result_type is nonsensical.

See also

Generator, Adaptable Unary Function, Adaptable Binary Function

Adaptable Unary Function

Category: functors

Component type: concept

Description

An Adaptable Unary Function is a Unary Function with nested typedef s that define its argument type and result type. [1] [2] These nested typedef make it possible to use function object adaptors.

Refinement of

Unary Function

Associated types
Argument type F::argument_type The type of F 's argument
Result type F::result_type The type returned when the Unary Function is called
Notation

FA type that is a model of Unary Function

Valid expressions

None, except for those defined by Unary Function

Models

• negate

• identity

• pointer_to_unary_function

Notes

[1] Note the implication of this: a function pointer T (*f)(X) is a Unary Function, but not an Adaptable Unary Function: the expressions f::argument_type and f::result_type are nonsensical.

[2] When you define a class that is a model of Adaptable Unary Function, you must provide these typedef s. The easiest way to do this is to derive the class from the base class unary_function . This is an empty class, with no member functions or member variables; the only reason it exists is to make defining Adaptable Unary Functions more convenient. Unary_function is very similar to the base classes used by the iterator tag functions.

See also

Unary Function, Adaptable Generator, Adaptable Binary Function

Adaptable Binary Function

Category: functors

Component type: concept

Description

An Adaptable Binary Function is a Binary Function with nested typedef s that define its argument types and result type. [1] [2] These nested typedef s make it possible to use function object adaptors.

Refinement of

Binary Function

Associated types
First argument type F::first_argument_type The type of F 's first argument
Second argument type F::second_argument_type The type of F 's second argument
Result type F::result_type The type returned when the Binary Function is called
Notation

FA type that is a model of Binary Function

Valid expressions

None, except for those defined by Binary Function

Models

• plus

• project1st

• pointer_to_binary_function

Notes

[1] Note the implication of this: a function pointer T (*f)(X,Y) is a Binary Function, but not an Adaptable Binary Function: the expressions f::first_argument_type , f::second_argument_type , and f::result_type are nonsensical.

[2] When you define a class that is a model of Adaptable Binary Function, you must provide these typedef s. The easiest way to do this is to derive the class from the base class binary_function . This is an empty class, with no member functions or member variables; the only reason it exists is to make defining Adaptable Binary Functions more convenient. Binary_function is very similar to the base classes used by the iterator tag functions.

See also

Binary Function, Adaptable Generator, Adaptable Unary Function

Predicates

Predicate

Category: functors

Component type: concept

Description

A Predicate is a Unary Function whose result represents the truth or falsehood of some condition. A Predicate might, for example, be a function that takes an argument of type int and returns true if the argument is positive.

Refinement of

Unary Function

Associated types
Result type The type returned when the Predicate is called. The result type must be convertible to bool .
Notation

FA type that is a model of Predicate

XThe argument type of F

fObject of type F

xObject of type X

Valid expressions
Name Expression Return type
Function call f(x) Convertible to bool
Expression semantics
Name Expression Precondition Semantics Postcondition
Function call f(x) x is in the domain of f . Returns true if the condition is satisfied, false if it is not. The result is either true or false .
Models

• bool (*)(int)

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «Standard Template Library Programmer's Guide»

Представляем Вашему вниманию похожие книги на «Standard Template Library Programmer's Guide» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «Standard Template Library Programmer's Guide»

Обсуждение, отзывы о книге «Standard Template Library Programmer's Guide» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x