MCPcopy Create free account
hub / github.com/KDAB/codebrowser / MaybeUnique

Class MaybeUnique

generator/compat.h:27–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26// clang 3.6 uses unique_ptr in many places that was not using it before
27template<typename T> struct MaybeUnique {
28 T *val;
29 operator T*() { return val; }
30 template <typename X> operator std::unique_ptr<X> () && { return std::unique_ptr<X>(val); }
31};
32template<typename T> MaybeUnique<T> maybe_unique(T* val) { return {val}; }
33
34#ifndef LLVM_FALLTHROUGH

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected