Standard Library Extensions

Introduction

This package provides extensions to the following standard library classes:

For the most part functions are injected into the std or std::tr1 namespace. There is no need to specify the namespace when using the functions. The function will be resolved with argument dependent name lookup. In the example below we find the minimum element in a std::vector and calculate the dot product of two std::vector's.

std::vector<double> x, y;
...
const double minValue = min(x);
const double d = dot(x, y); 

This is more concise than the following code.

const double minValue = *std::min_element(x.begin(), x.end())
double d = 0;
for (std::size_t i = 0; i != x.size(); ++i) {
   d += x[i] * y[i];
} 

STLib Home / http://www.its.caltech.edu/~sean/ / at(sean, dot(caltech, edu))