/* File : example.cpp */ #include "example.hxx" std::set create_iset(const int size, const int* values) { std::set iset; std::copy(values, values + size, std::inserter(iset, iset.begin())); return iset; } int sum_iset(const std::set iset) { int sum = 0; std::set::iterator it; for (it = iset.begin(); it != iset.end(); it++) { sum += *it; } return sum; } void concat_iset(std::set& iset, const std::set other_iset) { std::copy(other_iset.begin(), other_iset.end(), std::inserter(iset, iset.begin())); }