Public Member Functions | List of all members
lazylookup::vec< T > Class Template Reference

#include <lazylookup.hh>

Public Member Functions

 vec (std::function< T(std::size_t)> fn)
 
 vec (std::function< T(std::size_t)> fn, std::size_t N, std::size_t grow_limit=0)
 
void resize (std::size_t N)
 
void set_grow_limit (std::size_t grow_limit)
 
at (std::size_t i)
 
operator[] (std::size_t i)
 
std::size_t get_n_filled ()
 

Detailed Description

template<typename T>
class lazylookup::vec< T >

A lazy vector. This is suitable for when the function takes an unsigned integer and will be densly packed.

THIS WILL BE AUTOMATICALLY EXTENDED. USE ARR FOR A STATICLY SIZED VERSION.

It is possible to set an upper limit to how large it might be extended by using set_grow_limit(). In that case Fn will be called for all invocations above the max size.

Definition at line 101 of file lazylookup.hh.


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