Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Bringing persitent collections to c++
C++ Makefile
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Debug RRBTree first
Release Pop
PersistentVector.h RRBTree first
README.md fix readme
RRBVector.h
epl.html
main.cpp Pop

README.md

Gorgone

Turning mutability into stone.

Dependencies:

Boost 1.48

This library includes a set of classes that implement persistent collections. A persistent collection are immutable data that provide modified copies when manipulated.

PersistentVector creates a vector of T objects.

add(T &data) returns a copy of the PersistentVector with data inserted.

pop() returns a copy of PersistentVector without the last data

put(unsigned int pos, T &newData) return a copy of PersistentVector replacing the data in position pos with newData

size() return vector size

get(unsigned int pos) returns the data in position pos

main.cpp provides an example:

Creates a PersistentVector of Persistent vectors of long called v2.

Iteratively inserts new vectors into v2, each one copy of the previous with a new data added.

Iteratively calls pop() until v2 is empty.

Writes the ellapsed time between operations;

Repeats this procedure with two kind of Vectors in order to compare times:

TranisentVectorCopy. A transient vector that uses an std::vector.

TransientVectorSPtr. A transient vector that uses an std::vector >

Repeats the procedures again with a block of 10 chars.

License

Licensed under the EPL (see the file epl.html).

Something went wrong with that request. Please try again.