pstore2
Classes | Typedefs | Functions
sparse_array.hpp File Reference

Implements a sparse array type. More...

#include <numeric>
#include <type_traits>
#include "pstore/support/bit_count.hpp"
#include "pstore/support/error.hpp"
Include dependency graph for sparse_array.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  pstore::details::pair_field_iterator< Iterator, Accessor >
 
struct  pstore::sparray_bitmap< V, Enable >
 Derives the correct type for the bitmap field of a sparse_array<> given the maximum index value. More...
 
struct  pstore::enable_if_t<(V<=8U)> >
 
struct  pstore::sparray_bitmap< V, typename std::enable_if_t<(V > 8U &&V<=16U)> >
 
struct  pstore::sparray_bitmap< V, typename std::enable_if_t<(V > 16U &&V<=32U)> >
 
struct  pstore::sparray_bitmap< V, typename std::enable_if_t<(V > 32U &&V<=64U)> >
 
class  pstore::sparse_array< ValueType, BitmapType >
 A sparse array type. More...
 
class  pstore::sparse_array< ValueType, BitmapType >::indices
 
class  pstore::sparse_array< ValueType, BitmapType >::indices::const_iterator
 

Typedefs

template<std::uintmax_t V>
using pstore::sparray_bitmap_t = typename sparray_bitmap< V >::type
 

Functions

template<size_t I, typename Iterator >
decltype(auto) constexpr pstore::details::get_accessor () noexcept
 Returns a function which will return a reference to the Ith element of the tuple-like type produced by dereferencing an iterator of type Iterator. More...
 
template<typename ValueType , typename BitmapType >
bool pstore::operator== (sparse_array< ValueType, BitmapType > const &lhs, sparse_array< ValueType, BitmapType > const &rhs)
 
template<typename ValueType , typename BitmapType >
bool pstore::operator!= (sparse_array< ValueType, BitmapType > const &lhs, sparse_array< ValueType, BitmapType > const &rhs)
 
template<std::size_t Ip, typename ValueType , typename BitmapType >
constexpr ValueType & pstore::get (sparse_array< ValueType, BitmapType > &arr) noexcept
 
template<std::size_t Ip, typename ValueType , typename BitmapType >
constexpr ValueType const & pstore::get (sparse_array< ValueType, BitmapType > const &arr) noexcept
 

Detailed Description

Implements a sparse array type.

Function Documentation

◆ get_accessor()

template<size_t I, typename Iterator >
decltype(auto) constexpr pstore::details::get_accessor ( )
noexcept

Returns a function which will return a reference to the Ith element of the tuple-like type produced by dereferencing an iterator of type Iterator.

Template Parameters
IThe index of the item to be returned.
IteratorAn iterator type which, when dereferenced, will produce a tuple-like type.