#pragma once template bool is_ready(std::future const& f) { return f.wait_for(std::chrono::seconds(0)) == std::future_status::ready; } inline std::vector ExpandGlobOption(const argagg::option_results& opt) { std::vector expanded; for(const auto& o : opt.all) { const std::string r = o.as(); pangolin::FilesMatchingWildcard(r, expanded); } return expanded; } template inline std::vector TryLoad(const std::vector& in, const F& load_func) { std::vector loaded; for(const Tin& file : in) { try { loaded.emplace_back(load_func(file)); }catch(const std::exception&) { } } return loaded; }