export module lsd.scope_ptr; import std; export namespace lt::lsd { /** Wrapper around std::unique_ptr. * * @note Currently just an alias, might turn into an implementation later. * @ref https://en.cppreference.com/w/cpp/memory/unique_ptr.html */ template using scope = std::unique_ptr; /** Allocates memory for an `Underlying_T` and directly constructs it there. * * @return A Scope to the constructed object. */ template constexpr auto create_scope(Args &&...args) -> scope { return std::make_unique(std::forward(args)...); } /** Converts c-style pointer of type `Underlying_T` to a `Scope`. */ template constexpr auto make_scope(Underlying_T *raw_pointer) -> scope { return scope(raw_pointer); } } // namespace lt::lsd