summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-04-21 23:32:05 +0200
committerCarl Hetherington <cth@carlh.net>2020-04-21 23:34:02 +0200
commitf5980767b7d1d9b39186dd13f12b9d8297a87aef (patch)
tree3d137f1f69de64c24ae1a1cd884cd7df55d27be5
parent561eed2dc9978e890a020b6435ceb0333bb69a61 (diff)
Add list_to_vector().
-rw-r--r--src/lib/util.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/util.h b/src/lib/util.h
index 12c79ea5a..f8e9409f1 100644
--- a/src/lib/util.h
+++ b/src/lib/util.h
@@ -128,6 +128,17 @@ vector_to_list (std::vector<T> v)
return l;
}
+template <class T>
+std::vector<T>
+list_to_vector (std::list<T> v)
+{
+ std::vector<T> l;
+ BOOST_FOREACH (T& i, v) {
+ l.push_back (i);
+ }
+ return l;
+}
+
extern double db_to_linear (double db);
extern double linear_to_db (double linear);