@@ -223,7 +223,12 @@ template <typename E> class unexpected {
223223 *
224224 * @throws None if E is nothrow swappable.
225225 *
226- * @ingroup base_utilities
226+ * @note None.
227+ *
228+ * @warning None.
229+ *
230+ * @since 0.1
231+ * @ingroup base_utilities
227232 */
228233 void swap (unexpected& other) noexcept (std::is_nothrow_swappable_v<E>) {
229234 using std::swap;
@@ -292,11 +297,44 @@ template <typename T, typename E> class expected {
292297 " T must not be a reference (use T* or std::reference_wrapper)" );
293298 static_assert (!std::is_reference_v<E>, " E must not be a reference" );
294299
295- // / Internal storage union.
300+ /* *
301+ * @brief Internal storage union for value or error.
302+ *
303+ * Discriminated union that holds either the value or the error.
304+ * Only one member is active at any time.
305+ *
306+ * @note Trivial (no explicit initialization).
307+ *
308+ * @warning Direct access to members is unsafe; use has_val_ to
309+ * determine which member is active.
310+ *
311+ * @since 0.1
312+ * @ingroup base_utilities
313+ * @internal
314+ */
296315 union Storage {
297316 T val; // /< Value storage.
317+
298318 E err; // /< Error storage.
319+
320+ /* *
321+ * @brief Default constructor.
322+ *
323+ * @throws None.
324+ *
325+ * @since 0.1
326+ * @ingroup base_utilities
327+ */
299328 Storage () {}
329+
330+ /* *
331+ * @brief Destructor.
332+ *
333+ * @throws None.
334+ *
335+ * @since 0.1
336+ * @ingroup base_utilities
337+ */
300338 ~Storage () {}
301339 };
302340
@@ -1236,7 +1274,12 @@ template <typename T, typename E> class expected {
12361274 *
12371275 * @throws None if types are nothrow move constructible and swappable.
12381276 *
1239- * @ingroup base_utilities
1277+ * @note None.
1278+ *
1279+ * @warning None.
1280+ *
1281+ * @since 0.1
1282+ * @ingroup base_utilities
12401283 */
12411284 void swap (expected& o) noexcept (std::is_nothrow_move_constructible_v<T> &&
12421285 std::is_nothrow_swappable_v<T> &&
@@ -1287,7 +1330,12 @@ template <typename T, typename E> class expected {
12871330 *
12881331 * @throws None if types are nothrow move constructible and swappable.
12891332 *
1290- * @ingroup base_utilities
1333+ * @note None.
1334+ *
1335+ * @warning None.
1336+ *
1337+ * @since 0.1
1338+ * @ingroup base_utilities
12911339 */
12921340 friend void swap (expected& a, expected& b) noexcept (noexcept (a.swap(b))) { a.swap (b); }
12931341};
0 commit comments