From 00e9647a9ede540f2d567c19025278c25a87c830 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 27 Jan 2014 22:38:43 +0000 Subject: Various tweaks; work on read_dcp example. --- src/util.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/util.h') diff --git a/src/util.h b/src/util.h index e26c7332..e79c0a0b 100644 --- a/src/util.h +++ b/src/util.h @@ -86,6 +86,21 @@ extern std::string tm_to_string (struct tm *); extern std::string utc_offset_to_string (int); extern std::string ptime_to_string (boost::posix_time::ptime); extern FILE * fopen_boost (boost::filesystem::path, std::string); + +template +std::list > +list_of_type (std::list > const & from) +{ + std::list > out; + for (typename std::list >::const_iterator i = from.begin(); i != from.end(); ++i) { + boost::shared_ptr check = boost::dynamic_pointer_cast (*i); + if (check) { + out.push_back (check); + } + } + + return out; +} } -- cgit v1.2.3