| 1845 | }; |
| 1846 | |
| 1847 | template <typename L> class ContextScope : public ContextScopeBase |
| 1848 | { |
| 1849 | L lambda_; |
| 1850 | |
| 1851 | public: |
| 1852 | explicit ContextScope(const L &lambda) : lambda_(lambda) {} |
| 1853 | explicit ContextScope(L&& lambda) : lambda_(static_cast<L&&>(lambda)) { } |
| 1854 | |
| 1855 | ContextScope(const ContextScope&) = delete; |
| 1856 | ContextScope(ContextScope&&) noexcept = default; |
| 1857 | |
| 1858 | ContextScope& operator=(const ContextScope&) = delete; |
| 1859 | ContextScope& operator=(ContextScope&&) = delete; |
| 1860 | |
| 1861 | void stringify(std::ostream* s) const override { lambda_(s); } |
| 1862 | |
| 1863 | ~ContextScope() override { |
| 1864 | if (need_to_destroy) { |
| 1865 | destroy(); |
| 1866 | } |
| 1867 | } |
| 1868 | }; |
| 1869 | |
| 1870 | struct DOCTEST_INTERFACE MessageBuilder : public MessageData |
| 1871 | { |
nothing calls this directly
no outgoing calls
no test coverage detected