GTPin: gtpin::IntRange< T, S > Class Template Reference

GTPin

- Main Page
- Related Pages
- Modules
- Data Structures

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Data Structures | Public Member Functions
gtpin::IntRange< T, S > Class Template Reference
GTPin: Utilities

Iterable range of integral values. More...

`#include <gt_basic_defs.h>`

## Data Structures
class | Iterator
| Random iterator in the range. More...
## Public Member Functions
constexpr | IntRange ()
| Construct an empty range.
constexpr | IntRange (T first, S size)
| Construct a range in the specified bounds.
constexpr T | First () const
constexpr T | Base () const
constexpr T | End () const
constexpr S | Size () const
constexpr bool | IsEmpty () const
constexpr bool | Contains (T value) const
constexpr bool | Contains (const IntRange< T, S > &other) const
constexpr bool | Overlaps (const IntRange< T, S > &other) const
IntRange & | SetFirst (T first)
| Set origin, retain size of the range.
IntRange & | SetSize (S size)
| Set size, retain origin of the range.
IntRange & | Include (T value)
| If needed, extend boundaries of this range to include the specified value.
IntRange & | Include (const IntRange< T, S > &other)
| If needed, extend boundaries of this range to include the specified 'other' range.
IntRange & | Intersect (const IntRange< T, S > &other)
| Intersect this range with the specified 'other' range.

## Detailed Description

### template<typename T, typename S = size_t>
class gtpin::IntRange< T, S >

Iterable range of integral values.

Parameters:

  T | type of the value
  S | type of the range size

## Member Function Documentation

template<typename T , typename S = size_t>

constexpr T gtpin::IntRange< T, S >::Base | ( |  | ) | const`[inline]`

Returns:
  The first value in the range

template<typename T , typename S = size_t>

constexpr bool gtpin::IntRange< T, S >::Contains | ( | T | value | ) | const`[inline]`

Returns:
  true if specified value belongs to the range

template<typename T , typename S = size_t>

constexpr bool gtpin::IntRange< T, S >::Contains | ( | const IntRange< T, S > & | other | ) | const`[inline]`

Returns:
  true if this range contains the specified other range

template<typename T , typename S = size_t>

constexpr T gtpin::IntRange< T, S >::End | ( |  | ) | const`[inline]`

Returns:
  The end value of the range

template<typename T , typename S = size_t>

constexpr T gtpin::IntRange< T, S >::First | ( |  | ) | const`[inline]`

Returns:
  The first value in the range

template<typename T , typename S = size_t>

constexpr bool gtpin::IntRange< T, S >::IsEmpty | ( |  | ) | const`[inline]`

Returns:
  true if the range is empty

template<typename T , typename S = size_t>

constexpr bool gtpin::IntRange< T, S >::Overlaps | ( | const IntRange< T, S > & | other | ) | const`[inline]`

Returns:
  true if this range overlaps 'other' range

template<typename T , typename S = size_t>

constexpr S gtpin::IntRange< T, S >::Size | ( |  | ) | const`[inline]`

Returns:
  The number of values in the range

All Data Structures Functions Variables Typedefs Enumerations Enumerator

      Copyright (C) 2013-2025 Intel Corporation

      SPDX-License-Identifier: MIT