My Project
Public Types | Static Public Member Functions | List of all members
bsl::integer_sequence< T, INTS > Class Template Referencefinal

The class template std::integer_sequence represents a compile-time sequence of integers. When used as an argument to a function template, the parameter pack Ints can be deduced and used in pack expansion. More...

#include <integer_sequence.hpp>

Public Types

using value_type = T
 provides the member typedef "value_type"
 

Static Public Member Functions

static constexpr bsl::uintmax size () noexcept
 Equivalent to sizeof...(INTS) More...
 
static constexpr T max () noexcept
 Returns the max integer in the sequence. More...
 
static constexpr T min () noexcept
 Returns the min integer in the sequence. More...
 

Detailed Description

template<typename T, T... INTS>
class bsl::integer_sequence< T, INTS >

The class template std::integer_sequence represents a compile-time sequence of integers. When used as an argument to a function template, the parameter pack Ints can be deduced and used in pack expansion.

#include <bsl/debug.hpp>
namespace bsl
{
inline void
example_integer_sequence_overview() noexcept
{
constexpr bsl::uintmax size{6};
constexpr bsl::uintmax max{5};
constexpr bsl::uintmax min{0};
bsl::print() << "success\n";
}
bsl::print() << "success\n";
}
bsl::print() << "success\n";
}
}
}
Template Parameters
Tthe type that defines the sequence of integers
INTSthe integers that make up the integer sequence

Member Function Documentation

◆ size()

template<typename T , T... INTS>
static constexpr bsl::uintmax bsl::integer_sequence< T, INTS >::size ( )
inlinestaticnoexcept

Equivalent to sizeof...(INTS)

#include <bsl/debug.hpp>
namespace bsl
{
inline void
example_integer_sequence_size() noexcept
{
constexpr bsl::uintmax size{6};
bsl::print() << "success\n";
}
}
}
Returns
Equivalent to sizeof...(INTS)

◆ max()

template<typename T , T... INTS>
static constexpr T bsl::integer_sequence< T, INTS >::max ( )
inlinestaticnoexcept

Returns the max integer in the sequence.

#include <bsl/debug.hpp>
namespace bsl
{
inline void
example_integer_sequence_max() noexcept
{
constexpr bsl::uintmax max{5};
bsl::print() << "success\n";
}
}
}
Returns
Returns the max integer in the sequence

◆ min()

template<typename T , T... INTS>
static constexpr T bsl::integer_sequence< T, INTS >::min ( )
inlinestaticnoexcept

Returns the min integer in the sequence.

#include <bsl/debug.hpp>
namespace bsl
{
inline void
example_integer_sequence_min() noexcept
{
constexpr bsl::uintmax min{0};
bsl::print() << "success\n";
}
}
}
Returns
Returns the min integer in the sequence

The documentation for this class was generated from the following file: