Skip to content

Commit 9e23d5f

Browse files
committed
Use NOELDOC_EXPERIMENTAL_SINCE in Own.h types, add operator and NoOpDeleter addition in changelog
1 parent 7248b3b commit 9e23d5f

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ availableAt:
1010
#### Noelware.Violet.Experimental
1111
- [own] Add type traits for `Weak<T>` ([`@auguwu`])
1212
- [own] Add **DynamicCast**, **StaticCast**, and **ConstCast** for `Own<T>` to act like C++'s [`std::dynamic_pointer_cast`][cpp-pointer-cast], [`std::static_pointer_cast`][cpp-pointer-cast], and [`std::const_pointer_cast`][cpp-pointer-cast]. ([`@auguwu`])
13+
- [own] Add **==**, **!=**, and **<=>** operators for `Own<T>` ([`@auguwu`])
14+
- [own] Add **NoOpDeleter** deleter ([`@auguwu`])
1315

1416
[cpp-pointer-cast]: https://en.cppreference.com/cpp/memory/shared_ptr/pointer_cast
1517

include/violet/Experimental/Own.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ struct Own;
157157
/// derives from [`std::true_type`]. Prefer the [`is_owned_v`] variable template in
158158
/// most call sites.
159159
template<typename T>
160-
struct NOELDOC_SINCE("26.06.05") is_owned final: std::false_type { };
160+
struct NOELDOC_EXPERIMENTAL_SINCE("26.06.05") is_owned final: std::false_type { };
161161

162162
template<typename T>
163163
struct is_owned<Own<T>>: std::true_type { };
164164

165165
/// `true` if `T` is a specialization of [`Own`], `false` otherwise.
166166
template<typename T>
167-
NOELDOC_SINCE("26.06.05")
167+
NOELDOC_EXPERIMENTAL_SINCE("26.06.05")
168168
constexpr static inline bool is_owned_v = is_owned<T>::value;
169169

170170
/// Extracts the managed type from an [`Own`] specialization.
@@ -174,7 +174,7 @@ constexpr static inline bool is_owned_v = is_owned<T>::value;
174174
/// `T` is ill-formed; useful as a hard constraint. Prefer the [`owned_type_t`]
175175
/// alias.
176176
template<typename T>
177-
struct NOELDOC_SINCE("26.06.05") owned_type;
177+
struct NOELDOC_EXPERIMENTAL_SINCE("26.06.05") owned_type;
178178

179179
template<typename T>
180180
struct owned_type<Own<T>> final {
@@ -192,14 +192,14 @@ using owned_type_t = typename owned_type<T>::type;
192192
/// The [`Weak`] counterpart to [`is_owned`]. Prefer the [`is_weak_v`] variable
193193
/// template in most call sites.
194194
template<typename T>
195-
struct NOELDOC_SINCE("26.07.03") is_weak final: std::false_type { };
195+
struct NOELDOC_EXPERIMENTAL_SINCE("26.07.03") is_weak final: std::false_type { };
196196

197197
template<typename T>
198198
struct is_weak<Weak<T>>: std::true_type { };
199199

200200
/// `true` if `T` is a specialization of [`Weak`], `false` otherwise.
201201
template<typename T>
202-
NOELDOC_SINCE("26.07.03")
202+
NOELDOC_EXPERIMENTAL_SINCE("26.07.03")
203203
constexpr static inline bool is_weak_v = is_weak<T>::value;
204204

205205
/// Extracts the referenced type from a [`Weak`] specialization.
@@ -208,7 +208,7 @@ constexpr static inline bool is_weak_v = is_weak<T>::value;
208208
/// the primary template is incomplete, so naming `::type` for a non-[`Weak`] type
209209
/// is ill-formed. Prefer the [`weak_type_t`] alias.
210210
template<typename T>
211-
struct NOELDOC_SINCE("26.07.03") weak_type;
211+
struct NOELDOC_EXPERIMENTAL_SINCE("26.07.03") weak_type;
212212

213213
template<typename T>
214214
struct weak_type<Weak<T>> final {
@@ -232,7 +232,7 @@ using weak_type_t = typename weak_type<T>::type;
232232
/// int y = 32;
233233
/// Own<int> ref(&y, NoOpDeleter()); // shares `&y`, never deletes it
234234
/// ```
235-
struct NOELDOC_SINCE("26.07.03") NoOpDeleter final {
235+
struct NOELDOC_EXPERIMENTAL_SINCE("26.07.03") NoOpDeleter final {
236236
/// Constructs a [`NoOpDeleter`]. Stateless, so this is trivial.
237237
constexpr VIOLET_IMPLICIT NoOpDeleter() = default;
238238

@@ -249,7 +249,7 @@ struct NOELDOC_SINCE("26.07.03") NoOpDeleter final {
249249
///
250250
/// View the [module documentation](#) for more information.
251251
template<typename T>
252-
struct NOELDOC_SINCE("26.06.05") Own final {
252+
struct NOELDOC_EXPERIMENTAL_SINCE("26.06.05") Own final {
253253
using value_type = T;
254254

255255
~Own()
@@ -315,7 +315,7 @@ struct NOELDOC_SINCE("26.06.05") Own final {
315315
/// lifetime is tracked for it. A null `owner` yields a null handle regardless
316316
/// of `ptr`.
317317
template<typename U>
318-
NOELDOC_SINCE("26.07.03")
318+
NOELDOC_EXPERIMENTAL_SINCE("26.07.03")
319319
VIOLET_EXPLICIT Own(const Own<U>& owner, T* ptr) noexcept
320320
: n_data(owner.n_blk != nullptr ? ptr : nullptr)
321321
, n_blk(owner.n_blk)
@@ -334,7 +334,7 @@ struct NOELDOC_SINCE("26.06.05") Own final {
334334
/// regardless of `ptr`. Saves the atomic increment/decrement pair that the
335335
/// copying overload incurs.
336336
template<typename U>
337-
NOELDOC_SINCE("26.07.03")
337+
NOELDOC_EXPERIMENTAL_SINCE("26.07.03")
338338
// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
339339
VIOLET_EXPLICIT Own(Own<U>&& owner, T* ptr) noexcept
340340
: n_data(owner.n_blk != nullptr ? ptr : nullptr)

0 commit comments

Comments
 (0)