| 38 | // deleter. |
| 39 | template<typename Derived_t, typename Base_t> |
| 40 | static std::unique_ptr<Derived_t> dynamic_unique_ptr_cast(std::unique_ptr<Base_t>&& p) |
| 41 | { |
| 42 | if (auto* result = dynamic_cast<Derived_t*>(p.get())) |
| 43 | { |
| 44 | (void)p.release(); |
| 45 | return std::unique_ptr<Derived_t>(result); |
| 46 | } |
| 47 | return std::unique_ptr<Derived_t>(nullptr); |
| 48 | } |
| 49 | |
| 50 | static std::string trim(const std::string& str, const std::string& whitespace = " \t\n") |
| 51 | { |
nothing calls this directly
no outgoing calls
no test coverage detected