nil::crypto3::algebra::vector< T, N > Struct Template Reference

A container representing a vector. More...

#include <vector.hpp>

+ Collaboration diagram for nil::crypto3::algebra::vector< T, N >:

Public Types

using size_type = std::size_t
 
using value_type = T
 

Public Member Functions

Element access
constexpr T & operator[] (size_type i) noexcept
 access specified element More...
 
constexpr const T & operator[] (size_type i) const noexcept
 access specified element More...
 
Iterators
constexpr T * begin () noexcept
 returns an iterator to the beginning More...
 
constexpr T * end () noexcept
 returns an iterator to the end More...
 
constexpr const T * cbegin () const noexcept
 returns an iterator to the beginning More...
 
constexpr const T * cend () const noexcept
 returns an iterator to the end More...
 

Static Public Attributes

static constexpr size_type size = N
 size of the vector More...
 

Related Functions

(Note that these are not member functions.)

vector deduction guides
template<typename T , typename... U>
 vector (T, U...) -> vector< std::enable_if_t<(std::is_same_v< T, U > &&...), T >, 1+sizeof...(U)>
 deduction guide for uniform initialization More...
 
template<typename T , std::size_t N>
 vector (const T(&)[N]) -> vector< T, N >
 deduction guide for aggregate initialization More...
 

Detailed Description

template<typename T, std::size_t N>
struct nil::crypto3::algebra::vector< T, N >

A container representing a vector.

Template Parameters
Tscalar type to contain
Nsize of the vector

vector is a container representing a vector.

It is an aggregate type similar to std::array, and can be initialized with aggregate initialization or with the make_vector function.

Member Typedef Documentation

◆ size_type

template<typename T , std::size_t N>
using nil::crypto3::algebra::vector< T, N >::size_type = std::size_t

◆ value_type

template<typename T , std::size_t N>
using nil::crypto3::algebra::vector< T, N >::value_type = T

Member Function Documentation

◆ begin()

template<typename T , std::size_t N>
constexpr T* nil::crypto3::algebra::vector< T, N >::begin ( )
inlineconstexprnoexcept

returns an iterator to the beginning

Returns
an iterator to the beginning

Returns an iterator to the beginning of the vector.

◆ cbegin()

template<typename T , std::size_t N>
constexpr const T* nil::crypto3::algebra::vector< T, N >::cbegin ( ) const
inlineconstexprnoexcept

returns an iterator to the beginning

Returns
an iterator to the beginning

Returns an iterator to the beginning of the vector.

◆ cend()

template<typename T , std::size_t N>
constexpr const T* nil::crypto3::algebra::vector< T, N >::cend ( ) const
inlineconstexprnoexcept

returns an iterator to the end

Returns
an iterator past the end

Returns an iterator to the end of the vector.

◆ end()

template<typename T , std::size_t N>
constexpr T* nil::crypto3::algebra::vector< T, N >::end ( )
inlineconstexprnoexcept

returns an iterator to the end

Returns
an iterator past the end

Returns an iterator to the end of the vector.

◆ operator[]() [1/2]

template<typename T , std::size_t N>
constexpr const T& nil::crypto3::algebra::vector< T, N >::operator[] ( size_type  i) const
inlineconstexprnoexcept

access specified element

Parameters
iposition of the scalar element
Returns
the requested scalar element

Returns a reference to the scalar element in position i, without bounds checking.

◆ operator[]() [2/2]

template<typename T , std::size_t N>
constexpr T& nil::crypto3::algebra::vector< T, N >::operator[] ( size_type  i)
inlineconstexprnoexcept

access specified element

Parameters
iposition of the scalar element
Returns
the requested scalar element

Returns a reference to the scalar element in position i, without bounds checking.

Member Data Documentation

◆ size

template<typename T , std::size_t N>
constexpr size_type nil::crypto3::algebra::vector< T, N >::size = N
staticconstexpr

size of the vector


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