# Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world.

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

### Function Synopsis

In this section a single matrix is given, that shows all functions with shared names and identical or analogous semantics and their polymorphic overloads across the class templates of the icl. In order to achieve a concise representation, a series of placeholders are used throughout the function matrix.

The placeholder's purpose is to express the polymorphic usage of the functions. The first column of the function matrix contains the signatures of the functions. Within these signatures `T` denotes a container type and `J` and `P` polymorphic argument and result types.

Within the body of the matrix, sets of boldface placeholders denote the sets of possible instantiations for a polymorphic placeholder `P`. For instance e i S denotes that for the argument type `P`, an element e, an interval i or an interval_set S can be instantiated.

If the polymorphism can not be described in this way, only the number of overloaded implementations for the function of that row is shown.

Placeholder

Argument types

Description

`T`

a container or interval type

`P`

polymorphic container argument type

`J`

polymorphic iterator type

`K`

polymorphic element_iterator type for interval containers

`V`

various types `V`, that do dot fall in the categories above

1,2,...

number of implementations for this function

A

implementation generated by compilers

e

T::element_type

the element type of `interval_sets` or `std::sets`

i

T::segment_type

the segment type of of `interval_sets`

s

element sets

`std::set` or other models of the icl's set concept

S

interval_sets

one of the interval set types

b

T::element_type

type of `interval_map's` or `icl::map's` element value pairs

p

T::segment_type

type of `interval_map's` interval value pairs

m

element maps

`icl::map` icl's map type

M

interval_maps

one of the interval map types

d

discrete types

types with a least steppable discrete unit: Integral types, date/time types etc.

c

continuous types

types with (theoretically) infinitely many elements beween two values.

Table 1.13. Synopsis Functions and Overloads

T

intervals

interval
sets

interval
maps

element
sets

element
maps

`T::T()`

1

1

1

1

1

`T::T(const P&)`

A

1

1

```T& T::operator=(const P&)```

A

1

1

`void T::swap(T&)`

1

1

1

1

intervals

interval
sets

interval
maps

element
sets

element
maps

`bool T::empty()const`

1

1

1

1

`bool is_empty(const T&)`

1

1

1

1

1

```bool contains(const T&, const P&)```
```bool within(const P&, const T&)```

intervals

interval
sets

interval
maps

element
sets

element
maps

```bool operator == (const T&, const T&)```

1

1

1

1

1

```bool operator != (const T&, const T&)```

1

1

1

1

1

```bool operator < (const T&, const T&)```

1

1

1

1

1

```bool operator > (const T&, const T&)```

1

1

1

1

1

```bool operator <= (const T&, const T&)```

1

1

1

1

1

```bool operator >= (const T&, const T&)```

1

1

1

1

1

```bool is_element_equal(const T&, const P&)```

1

1

```bool is_element_less(const T&, const P&)```

1

1

```bool is_element_greater(const T&, const P&)```

1

1

```bool is_distinct_equal(const T&, const P&)```

1

intervals

interval
sets

interval
maps

element
sets

element
maps

`size_type T::size()const`

1

1

1

1

`size_type size(const T&)`

1

1

1

1

1

`size_type cardinality(const T&)`

1

1

1

1

1

`difference_type length(const T&)`

1

1

1

`size_type iterative_size(const T&)`

1

1

1

1

`size_type interval_count(const T&)`

1

1

`J T::find(const P&)`

2

2

```J find(T&, const P&)```

```codomain_type& operator[] (const domain_type&)```

1

`codomain_type operator() (const domain_type&)const`

1

1

`interval_type hull(const T&)`

1

1

```T hull(const T&, const T&)```

1

`domain_type lower(const T&)`

1

1

1

`domain_type upper(const T&)`

1

1

1

`domain_type first(const T&)`

1

1

1

`domain_type last(const T&)`

1

1

1

intervals

interval
sets

interval
maps

element
sets

element
maps

```T& T::add(const P&)```

```T& add(T&, const P&)```

`J T::add(J pos, const P&)`

```J add(T&, J pos, const P&)```

```T& operator +=(T&, const P&)```

```T operator + (T, const P&)```
```T operator + (const P&, T)```

```T& operator |=( T&, const P&)```

```T operator | (T, const P&)```
```T operator | (const P&, T)```

```T& T::subtract(const P&)```

```T& subtract(T&, const P&)```

```T& operator -=(T&, const P&)```

```T operator - (T, const P&)```

`T left_subtract(T, const T&)`

1

`T right_subtract(T, const T&)`

1

intervals

interval
sets

interval
maps

element
sets

element
maps

`V T::insert(const P&)`

```V insert(T&, const P&)```

`J T::insert(J pos, const P&)`

```J insert(T&, J pos, const P&)```

```T& insert(T&, const P&)```

```T& T::set(const P&)```

1

```T& set_at(T&, const P&)```

1

`void T::clear()`

1

1

1

1

`void clear(const T&)`

1

1

1

1

```T& T::erase(const P&)```

```T& erase(T&, const P&)```

`void T::erase(iterator)`

1

1

1

1

`void T::erase(iterator,iterator)`

1

1

1

1

intervals

interval
sets

interval
maps

element
sets

element
maps

```void add_intersection(T&, const T&, const P&)```

```T& operator &=(T&, const P&)```

```T operator & (T, const P&)```
```T operator & (const P&, T)```

```bool intersects(const T&, const P&)```
```bool disjoint(const T&, const P&)```

```T& T::flip(const P&)```

```T& flip(T&, const P&)```

```T& operator ^=(T&, const P&)```

```T operator ^ (T, const P&)```
```T operator ^ (const P&, T)```

intervals

interval
sets

interval
maps

element
sets

element
maps

`J T::begin()`

2

2

2

2

`J T::end()`

2

2

2

2

`J T::rbegin()`

2

2

2

2

`J T::rend()`

2

2

2

2

`J T::lower_bound(const key_type&)`

2

2

2

2

`J T::upper_bound(const key_type&)`

2

2

2

2

`pair<J,J> T::equal_range(const key_type&)`

2

2

2

2

intervals

interval
sets

interval
maps

element
sets

element
maps

`K elements_begin(T&)`

2

2

`K elements_end(T&)`

2

2

`K elements_rbegin(T&)`

2

2

`K elements_rend(T&)`

2

2

intervals

interval
sets

interval
maps

element
sets

element
maps

```std::basic_ostream operator << (basic_ostream&, const T&)```

1

1

1

1

1

Many but not all functions of icl intervals are listed in the table above. Some specific functions are summarized in the next table. For the group of the constructing functions, placeholders d denote discrete domain types and c denote continuous domain types `T::domain_type` for an interval_type `T` and an argument types `P`.

Table 1.14. Additional interval functions

T

discrete
_interval

continuous
_interval

right_open
_interval

left_open
_interval

closed
_interval

open
_interval

Interval bounds

dynamic

dynamic

static

static

static

static

Form

asymmetric

asymmetric

symmetric

symmetric

`T singleton(const P&)`

```T construct(const P&, const P&)```

```T construct(const P&, const P&, interval_bounds)```

```T hull(const P&, const P&)```

```T span(const P&, const P&)```

```static T right_open(const P&, const P&)```

```static T left_open(const P&, const P&)```

```static T closed(const P&, const P&)```

```static T open(const P&, const P&)```

```bool exclusive_less(const T&, const T&)```

1

1

1

1

1

1

```bool lower_less(const T&, const T&)```
```bool lower_equal(const T&, const T&)```
```bool lower_less_equal(const T&, const T&)```

1

1

1

1

1

1

```bool upper_less(const T&, const T&)```
```bool upper_equal(const T&, const T&)```
```bool upper_less_equal(const T&, const T&)```

1

1

1

1

1

1

```bool touches(const T&, const T&)```

1

1

1

1

1

1

```T inner_complement(const T&, const T&)```

1

1

1

1

1

1

```difference_type distance(const T&, const T&)```

1

1

1

1

1

1

##### Element iterators for interval containers

Iterators on interval conainers that are refered to in section Iteration of the function synopsis table are segment iterators. They reveal the more implementation specific aspect, that the fundamental aspect abstracts from. Iteration over segments is fast, compared to an iteration over elements, particularly if intervals are large. But if we want to view our interval containers as containers of elements that are usable with std::algoritms, we need to iterate over elements.

Iteration over elements . . .

• is possible only for integral or discrete `domain_types`
• can be very slow if the intervals are very large.
• and is therefore depreciated

On the other hand, sometimes iteration over interval containers on the element level might be desired, if you have some interface that works for `std::SortedAssociativeContainers` of elements and you need to quickly use it with an interval container. Accepting the poorer performance might be less bothersome at times than adjusting your whole interface for segment iteration.

Caution So we advice you to choose element iteration over interval containers judiciously. Do not use element iteration by default or habitual. Always try to achieve results using namespace global functions or operators (preferably inplace versions) or iteration over segments first.
{"ft_lang_label":"__label__en","ft_lang_prob":0.50815207,"math_prob":0.9570794,"size":5655,"snap":"2019-13-2019-22","text_gpt3_token_len":1891,"char_repetition_ratio":0.38435674,"word_repetition_ratio":0.55039316,"special_character_ratio":0.40689656,"punctuation_ratio":0.07762557,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98425096,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,null,null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-03-19T06:26:01Z\",\"WARC-Record-ID\":\"<urn:uuid:2d54b75e-b6ad-4405-8282-aa6b544a49c1>\",\"Content-Length\":\"146019\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:7b2fa298-4e78-4d7e-95f3-ee3cdd65eeec>\",\"WARC-Concurrent-To\":\"<urn:uuid:8f08633e-a860-4233-93eb-6bd4b9f817c9>\",\"WARC-IP-Address\":\"146.20.110.251\",\"WARC-Target-URI\":\"https://www.boost.org/doc/libs/1_56_0/libs/icl/doc/html/boost_icl/interface/function_synopsis.html\",\"WARC-Payload-Digest\":\"sha1:CCURO4YSG5ZBNCKWYK2QAVKJNMQCFKOM\",\"WARC-Block-Digest\":\"sha1:MWO364SK5YAHWTCFHQUEE3P6MNGJC24I\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-13/CC-MAIN-2019-13_segments_1552912201904.55_warc_CC-MAIN-20190319052517-20190319074517-00190.warc.gz\"}"}