MCPcopy Create free account
hub / github.com/Compaile/ctrack / ContextScope

Class ContextScope

test/doctest.h:1847–1868  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected