[libcxx-commits] [libcxx] [libc++][memory] P1132R8: `out_ptr` - a scalable output pointer abstraction (PR #73618)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jul 15 10:40:53 PDT 2024
================
@@ -0,0 +1,99 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP___OUT_PTR_H
+#define _LIBCPP___OUT_PTR_H
+
+#include <__config>
+#include <__memory/addressof.h>
+#include <__memory/pointer_traits.h>
+#include <__memory/shared_ptr.h>
+#include <__memory/unique_ptr.h>
+#include <__type_traits/is_specialization.h>
+#include <__type_traits/is_void.h>
+#include <__utility/forward.h>
+#include <__utility/move.h>
+#include <tuple>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+# pragma GCC system_header
+#endif
+
+_LIBCPP_PUSH_MACROS
+#include <__undef_macros>
+
+_LIBCPP_BEGIN_NAMESPACE_STD
+
+#if _LIBCPP_STD_VER >= 23
+
+template <class _Smart, class _Pointer, class... _Args>
+class _LIBCPP_TEMPLATE_VIS out_ptr_t {
+ static_assert(!__is_specialization_v<_Smart, shared_ptr> || sizeof...(_Args) > 0,
+ "Specialization of std::shared_ptr<> requires a deleter.");
----------------
ldionne wrote:
```suggestion
"Using std::shared_ptr<> without a deleter in std::out_ptr is not supported.");
```
Or
```suggestion
"Using std::shared_ptr<> in std::out_ptr requires a deleter.");
```
https://github.com/llvm/llvm-project/pull/73618
More information about the libcxx-commits
mailing list