Flow
Documentation for the Flow C++ Library
Loading...
Searching...
No Matches
flow::VectorGrowthStrategy::FibonacciExpand Struct Reference

#include <flow_vector.h>

Public Member Functions

std::size_t operator() (std::size_t oldCapacity)

Public Attributes

std::size_t n1 = 0
std::size_t n2 = 1

Detailed Description

Definition at line 34 of file flow_vector.h.

Member Function Documentation

◆ operator()()

std::size_t flow::VectorGrowthStrategy::FibonacciExpand::operator() ( std::size_t oldCapacity)
inline

Definition at line 37 of file flow_vector.h.

37 {
38 do {
39 std::size_t n3 = n1 + n2;
40 n1 = n2;
41 n2 = n3;
42 } while (n2 <= oldCapacity);
43 return n2;
44 }

References n1, and n2.

Member Data Documentation

◆ n1

std::size_t flow::VectorGrowthStrategy::FibonacciExpand::n1 = 0

Definition at line 35 of file flow_vector.h.

Referenced by operator()().

◆ n2

std::size_t flow::VectorGrowthStrategy::FibonacciExpand::n2 = 1

Definition at line 36 of file flow_vector.h.

Referenced by operator()().


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