Libraries

Everything available in C++ Mode out of the box.

None of these require an #include. They are all automatically available in every sketch through Processing.h.

Containers

std::vector

Dynamic array. The most common container. Use instead of Java's ArrayList.

std::map

Key-value pairs sorted by key.

std::unordered_map

Hash map. Faster lookups than std::map but unsorted.

std::set

Sorted collection of unique values.

std::unordered_set

Hash set. Faster lookups than std::set but unsorted.

std::list

Doubly linked list. Fast insert and remove at any position.

std::deque

Double-ended queue. Fast insert and remove at both ends.

std::queue

FIFO queue adapter.

std::stack

LIFO stack adapter.

Algorithms

std::sort

Sort any container. Works with lambdas for custom comparison.

std::find

Find an element in a range.

std::remove_if

Remove elements matching a condition. Commonly used with vectors.

std::min / std::max

Min and max of two values.

std::accumulate

Sum or fold a range of values.

std::transform

Apply a function to every element in a range.

std::iterator

Iterator utilities for working with ranges and containers.

Strings and IO

std::string

Text string. Use instead of Java's String.

std::stringstream

Build strings from mixed types.

std::ifstream

Read from files.

std::ofstream

Write to files.

std::regex

Regular expressions for pattern matching.

std::cout / std::cerr

Print to the console. Also available as println().

std::iomanip

Format output — set precision, width, fill characters.

Concurrency

std::thread

Run code on a separate thread.

std::functional

Function wrappers, std::function, std::bind, lambdas.

Utilities

std::optional

A value that may or may not be present.

std::variant

A value that can be one of several types.

std::tuple

A fixed-size collection of values of different types.

std::unique_ptr / std::shared_ptr

Smart pointers for automatic memory management.

std::chrono

Time utilities. Measure durations and get the current time.

std::cstdlib / std::ctime

C standard library utilities and time functions.

Math

std::cmath

sin, cos, tan, sqrt, pow, abs, floor, ceil and more.

std::random

Random number generation. Also available as random().

std::numeric

iota, accumulate, inner_product and more.