66#include < tuple>
77#include < type_traits>
88
9+ /* *
10+ * \brief The namespace containing all of fpgen's code.
11+ */
912namespace fpgen {
13+ /* *
14+ * \brief Aggregates all data in the generator to a dataset.
15+ *
16+ * The supplied container should support `push_back` (like most of the `std::`
17+ * containers). Each element is extracted from the generator and inserted into
18+ * the container. The container is not cleared before inserting. Elements
19+ * already extracted (due to previous calls to the generator, ...) cannot be
20+ * reconstructed.
21+ *
22+ * \tparam T The type contained in the container and generator.
23+ * \tparam Args Other parameters to be passed to the container.
24+ * \tparam Container The container type to output to.
25+ * \param[in, out] gen The generator to extract from.
26+ * \param[out] out The container to output to.
27+ * \returns A reference to the modified container.
28+ */
1029template <typename T, typename ... Args,
1130 template <typename ...> typename Container>
1231Container<T, Args...> &aggregate_to (generator<T> &gen,
@@ -17,6 +36,22 @@ Container<T, Args...> &aggregate_to(generator<T> &gen,
1736 return out;
1837}
1938
39+ /* *
40+ * \brief Aggregates all data in the generator into an associative container.
41+ *
42+ * The supplied container should support `operator[]` (by reference, like
43+ * `std::map`). Duplicate key values will be be overwritten. The container is
44+ * not cleared before writing. Elements that have already been extracted from
45+ * the generator cannot be reconstructed.
46+ *
47+ * \tparam TKey The key type for the container.
48+ * \tparam TValue The value type for the container.
49+ * \tparam Args Other parameters to be passed to the container.
50+ * \tparam Container The container to be used.
51+ * \param[in, out] gen The generator to extract from.
52+ * \param[out] out The container to insert to.
53+ * \returns A reference to the modified container.
54+ */
2055template <typename TKey, typename TVal, typename ... Args,
2156 template <typename ...> typename Container>
2257Container<TKey, TVal, Args...> &
0 commit comments