| 69 | |
| 70 | template<typename R> |
| 71 | auto toVector(R&& range) { |
| 72 | using T = std::ranges::range_value_t<R>; |
| 73 | std::vector<T> result; |
| 74 | if constexpr (std::ranges::common_range<R>) { |
| 75 | result.reserve(std::ranges::distance(range)); |
| 76 | } |
| 77 | std::ranges::copy(range, std::back_inserter(result)); |
| 78 | return result; |
| 79 | } |
| 80 | |
| 81 | std::vector<std::shared_ptr<Device>> findDevices(const std::function<bool(const std::shared_ptr<Device>&)>& filterFunction) { |
| 82 | auto scoped_mutex = mutex.asScopedLock(); |