• R/O
  • SSH

YSLib: Commit

The YSLib project - main repository


Commit MetaInfo

Revisionad10f75265b27e76c825eb199bea076667b13ffb (tree)
Time2024-02-27 01:28:20
AuthorFrankHB <frankhb1989@gmai...>
CommiterFrankHB

Log Message

更新主分支版本: build 982 rev 10 。

Change Summary

    Incremental Difference

    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/array.hpp
    --- a/YBase/include/ystdex/array.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/array.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2012-2015, 2018, 2022 FrankHB.
    2+ © 2012-2015, 2018, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file array.hpp
    1212 \ingroup YStandardEx
    1313 \brief 数组操作。
    14-\version r175
    14+\version r180
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 532
    1717 \par 创建时间:
    1818 2014-09-01 18:39:25 +0800
    1919 \par 修改时间:
    20- 2022-06-05 01:40 +0800
    20+ 2023-12-20 20:47 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -42,7 +42,7 @@
    4242 \see WG21 N4315 。
    4343 \since build 562
    4444 */
    45-//@{
    45+//!@{
    4646 /*!
    4747 \ingroup metafunctions
    4848 \brief 取指定类型和参数类型推断的 std::array 实例。
    @@ -79,13 +79,13 @@
    7979 {
    8080 return {{ystdex::decay_copy(args)...}};
    8181 }
    82-//@}
    82+//!@}
    8383
    8484 /*!
    8585 \brief 转换指定参数为 \c std::array 对象。
    8686 \since build 337
    8787 */
    88-//@{
    88+//!@{
    8989 template<typename _type, size_t _vN, typename _tSrc>
    9090 yconstfn std::array<_type, _vN>
    9191 to_array(const _tSrc& src)
    @@ -128,7 +128,7 @@
    128128 std::min(_vN, il.size()), std::addressof(arr[0]));
    129129 return arr;
    130130 }
    131-//@}
    131+//!@}
    132132
    133133 } // namespace ystdex;
    134134
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/base.h
    --- a/YBase/include/ystdex/base.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/base.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2013-2015, 2017-2019, 2021-2022 FrankHB.
    2+ © 2013-2015, 2017-2019, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file base.h
    1212 \ingroup YStandardEx
    1313 \brief 基类实用设施。
    14-\version r262
    14+\version r270
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 556
    1717 \par 创建时间:
    1818 2014-11-28 11:59:15 +0800
    1919 \par 修改时间:
    20- 2022-02-08 03:15 +0800
    20+ 2023-12-20 20:44 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -31,7 +31,7 @@
    3131 https://stackoverflow.com/questions/10788823 的讨论。
    3232 ISO C++20 的规则(自 WG21 P840R2 )进一步明确了空基类的情形,但没有实质变化。
    3333 Microsoft VC++ 因为 ABI 兼容问题不会在短期实现符合 ISO C++11 要求的空基类优化,
    34- 而同时需要使用 __declspec(empty_bases) 变通,参见:
    34+ 而同时需要使用 __declspec(empty_bases) 变通,参见:
    3535 https://devblogs.microsoft.com/cppblog/optimizing-the-layout-of-empty-base-classes-in-vs2015-update-2-3/ ;
    3636 https://developercommunity.visualstudio.com/t/no-unique-address-attribute-isnt-working/954963 。
    3737 */
    @@ -54,7 +54,7 @@
    5454 {
    5555
    5656 //! \warning 非虚析构。
    57-//@{
    57+//!@{
    5858 /*!
    5959 \brief 不可复制对象:禁止派生类调用默认原型的复制构造函数和复制赋值操作符。
    6060 \note WG21 N2600 在 ISO C++11 之前提议一个更简单的实现,但没有被标准采纳。
    @@ -115,7 +115,7 @@
    115115
    116116 public:
    117117 //! \since build 551
    118- //@{
    118+ //!@{
    119119 //! \brief 允许复制构造。
    120120 yconstfn
    121121 nonmovable(const nonmovable&) = default;
    @@ -129,9 +129,9 @@
    129129 //! \brief 禁止转移赋值。
    130130 nonmovable&
    131131 operator=(nonmovable&&) = delete;
    132- //@}
    132+ //!@}
    133133 };
    134-//@}
    134+//!@}
    135135
    136136
    137137 /*!
    @@ -227,7 +227,7 @@
    227227 } // namespace bases;
    228228
    229229 //! \since build 834
    230-//@{
    230+//!@{
    231231 using noncopyable = bases::noncopyable;
    232232
    233233 using nonmovable = bases::nonmovable;
    @@ -239,7 +239,7 @@
    239239
    240240 template<class _tBase, typename... _tParams>
    241241 using derived_entity = bases::derived_entity<_tBase, _tParams...>;
    242-//@}
    242+//!@}
    243243
    244244 } // namespace ystdex;
    245245
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/bind.hpp
    --- a/YBase/include/ystdex/bind.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/bind.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2012, 2014-2015, 2018-2019, 2022 FrankHB.
    2+ © 2012, 2014-2015, 2018-2019, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file bind.hpp
    1212 \ingroup YStandardEx
    1313 \brief 函数部分应用。
    14-\version r5305
    14+\version r5308
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 939
    1717 \par 创建时间:
    1818 2022-02-13 09:10:49 +0800
    1919 \par 修改时间:
    20- 2022-02-14 18:01 +0800
    20+ 2023-12-20 20:47 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -38,7 +38,7 @@
    3838 \brief 复合调用 std::bind 和 std::placeholders::_1 。
    3939 \note ISO C++ 要求 std::placeholders::_1 被实现支持。
    4040 */
    41-//@{
    41+//!@{
    4242 //! \since build 628
    4343 template<typename _func, typename... _tParams>
    4444 YB_ATTR_nodiscard YB_PURE inline auto
    @@ -56,7 +56,7 @@
    5656 return
    5757 std::bind<_tRes>(yforward(f), std::placeholders::_1, yforward(args)...);
    5858 }
    59-//@}
    59+//!@}
    6060
    6161 /*!
    6262 \brief 复合调用 ystdex::bind1 和 std::placeholders::_2 以实现值的设置。
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/bit.hpp
    --- a/YBase/include/ystdex/bit.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/bit.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2015-2016, 2018-2022 FrankHB.
    2+ © 2015-2016, 2018-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file bit.hpp
    1212 \ingroup YStandardEx
    1313 \brief 位操作。
    14-\version r1405
    14+\version r1419
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 245
    1717 \par 创建时间:
    1818 2021-12-18 22:57:19 +0800
    1919 \par 修改时间:
    20- 2022-11-28 19:03 +0800
    20+ 2023-12-20 20:45 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -78,7 +78,7 @@
    7878
    7979
    8080 //! \since build 695
    81-//@{
    81+//!@{
    8282 namespace details
    8383 {
    8484
    @@ -113,7 +113,7 @@
    113113 {
    114114 return bool(details::bit_order_tester{1}.le & 1);
    115115 }
    116-//@}
    116+//!@}
    117117
    118118
    119119 //! \brief 判断无符号整数是否为 2 的整数次幂。
    @@ -139,14 +139,14 @@
    139139 {
    140140
    141141 //! \since build 933
    142-//@{
    142+//!@{
    143143 // XXX: Current policy does not relies on features specific to concrete
    144144 // microarchitectures. Consideration of '__builtin_ia32_lzcnt_u*' and
    145145 // '__builtin_ia32_tzcnt_u*' is deferred. Note GCC 7.0 may not work, see
    146146 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78057.
    147147 //! \pre <tt>x != 0</tt> 。
    148-//@{
    149-// XXX: There is no use of %__builtin_clzs, since it is less portable. See
    148+//!@{
    149+// XXX: There is no use of %__builtin_clzs, since it is less portable.
    150150 # if !(__has_builtin(__builtin_clz) && __has_builtin(__builtin_clzl) \
    151151 && __has_builtin(__builtin_clzll)) || !(YB_IMPL_GNUC >= 30400)
    152152 template<size_t>
    @@ -370,8 +370,8 @@
    370370 return details::ctz(unsigned(x)) - (std::numeric_limits<unsigned>::digits
    371371 - std::numeric_limits<unsigned short>::digits);
    372372 }
    373-//@}
    374-//@}
    373+//!@}
    374+//!@}
    375375
    376376
    377377 //! \since build 849
    @@ -391,7 +391,7 @@
    391391 \pre <tt>x != 0</tt> 。
    392392 \since build 933
    393393 */
    394-//@{
    394+//!@{
    395395 template<size_t _vN, typename _type>
    396396 YB_ATTR_nodiscard YB_ATTR_always_inline YB_STATELESS inline size_t
    397397 floor_lb_w(_type x, size_t_<_vN>) ynothrowv
    @@ -466,7 +466,7 @@
    466466 // XXX: %__lzcnt is not used now.
    467467 return details::floor_lb_w(x, size_t_<32>());
    468468 }
    469-//@}
    469+//!@}
    470470
    471471 } // namespace details;
    472472
    @@ -496,7 +496,7 @@
    496496
    497497
    498498 //! \pre <tt>x != 0</tt> 。
    499-//@{
    499+//!@{
    500500 //! \brief 同 ISO C++20 的 countl_zero ,但对参数为 0 时结果未定义。
    501501 template<typename _type>
    502502 YB_ATTR_nodiscard YB_ATTR_always_inline YB_STATELESS yimpl(yconstfn)
    @@ -513,7 +513,7 @@
    513513 {
    514514 return details::ctz(x);
    515515 }
    516-//@}
    516+//!@}
    517517
    518518 inline namespace cpp2020
    519519 {
    @@ -525,7 +525,7 @@
    525525 扩展可能实际支持在要求常量表达式的上下文中使用,但通常没有公开保证。
    526526 替代实现只支持至多 64 位整数。
    527527 */
    528-//@{
    528+//!@{
    529529 #if __cpp_lib_bitops >= 201907L
    530530 using std::countl_zero;
    531531 using std::countr_zero;
    @@ -546,7 +546,7 @@
    546546 return x != 0 ? details::ctz(x) : std::numeric_limits<_type>::digits;
    547547 }
    548548 #endif
    549-//@}
    549+//!@}
    550550
    551551 } // inline namespace cpp2020;
    552552
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/deref_op.hpp
    --- a/YBase/include/ystdex/deref_op.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/deref_op.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2011-2016, 2018-2019, 2021-2022 FrankHB.
    2+ © 2011-2016, 2018-2019, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file deref_op.hpp
    1212 \ingroup YStandardEx
    1313 \brief 解引用操作。
    14-\version r265
    14+\version r278
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 576
    1717 \par 创建时间:
    1818 2015-02-10 13:12:26 +0800
    1919 \par 修改时间:
    20- 2022-11-28 19:53 +0800
    20+ 2023-12-20 20:47 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -40,7 +40,7 @@
    4040 \note 注意返回 \c false 不表示参数实际可解引用。
    4141 \since build 461
    4242 */
    43-//@{
    43+//!@{
    4444 template<typename _tIter>
    4545 yconstfn bool
    4646 is_undereferenceable(const _tIter&) ynothrow
    @@ -53,7 +53,7 @@
    5353 {
    5454 return !p;
    5555 }
    56-//@}
    56+//!@}
    5757
    5858
    5959 /*!
    @@ -68,9 +68,9 @@
    6868
    6969
    7070 //! \since build 749
    71-//@{
    71+//!@{
    7272 //! \brief 取非空引用或默认值。
    73-//@{
    73+//!@{
    7474 template<typename _type>
    7575 yconstfn auto
    7676 nonnull_or(_type&& p) -> decay_t<decltype(yforward(p))>
    @@ -92,10 +92,10 @@
    9292 {
    9393 return !bool(p == yforward(last)) ? yforward(p) : yforward(other);
    9494 }
    95-//@}
    95+//!@}
    9696
    9797 //! \brief 调用非引用或默认值。
    98-//@{
    98+//!@{
    9999 template<typename _type, typename _func>
    100100 yconstfn auto
    101101 call_nonnull_or(_func f, _type&& p) -> decay_t<decltype(f(yforward(p)))>
    @@ -118,11 +118,11 @@
    118118 {
    119119 return !bool(p == yforward(last)) ? f(yforward(p)) : yforward(other);
    120120 }
    121-//@}
    121+//!@}
    122122
    123123
    124124 //! \brief 取非空值或默认值。
    125-//@{
    125+//!@{
    126126 template<typename _type>
    127127 yconstfn auto
    128128 value_or(_type&& p) -> decay_t<decltype(*yforward(p))>
    @@ -143,10 +143,10 @@
    143143 {
    144144 return !bool(p == yforward(last)) ? *yforward(p) : yforward(other);
    145145 }
    146-//@}
    146+//!@}
    147147
    148148 //! \brief 调用非空值或取默认值。
    149-//@{
    149+//!@{
    150150 template<typename _type, typename _func>
    151151 yconstfn auto
    152152 call_value_or(_func f, _type&& p) -> decay_t<decltype(f(*yforward(p)))>
    @@ -168,8 +168,8 @@
    168168 {
    169169 return !bool(p == yforward(last)) ? f(*yforward(p)) : yforward(other);
    170170 }
    171-//@}
    172-//@}
    171+//!@}
    172+//!@}
    173173
    174174 } // namespace ystdex;
    175175
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/examiner.hpp
    --- a/YBase/include/ystdex/examiner.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/examiner.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2012-2013, 2015-2016, 2018-2022 FrankHB.
    2+ © 2012-2013, 2015-2016, 2018-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file examiner.hpp
    1212 \ingroup YStandardEx
    1313 \brief C++ 类型操作检测。
    14-\version r148
    14+\version r150
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 348
    1717 \par 创建时间:
    1818 2012-10-17 01:21:01 +0800
    1919 \par 修改时间:
    20- 2022-02-04 16:13 +0800
    20+ 2023-12-22 23:02 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -75,7 +75,7 @@
    7575 {
    7676 //! \since build 675
    7777 template<typename _type, typename _type2, yimpl(typename
    78- = enable_if_t<!has_equality_operator<_type&&, _type2&&>::value>)>
    78+ = enable_if_t<!has_equality_operator<_type, _type2>::value>)>
    7979 YB_STATELESS static yconstfn bool
    8080 are_equal(_type&&, _type2&&) ynothrow
    8181 {
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/exception.h
    --- a/YBase/include/ystdex/exception.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/exception.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2014-2018, 2020-2022 FrankHB.
    2+ © 2014-2018, 2020-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file exception.h
    1212 \ingroup YStandardEx
    1313 \brief 标准库异常扩展接口。
    14-\version r341
    14+\version r352
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 522
    1717 \par 创建时间:
    1818 2014-07-25 20:14:51 +0800
    1919 \par 修改时间:
    20- 2022-10-07 20:21 +0800
    20+ 2023-12-20 20:32 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -110,7 +110,7 @@
    110110 \since build 475
    111111 \ingroup exceptions
    112112 */
    113-//@{
    113+//!@{
    114114 //! \brief 异常:不支持的操作。
    115115 class YB_API unsupported : public std::logic_error
    116116 {
    @@ -167,11 +167,11 @@
    167167 //! \brief 虚析构:类定义外默认实现。
    168168 ~narrowing_error() override;
    169169 };
    170-//@}
    170+//!@}
    171171
    172172
    173173 //! \since build 686
    174-//@{
    174+//!@{
    175175 //! \brief 使用不满足构造限制检查导致的异常。
    176176 class YB_API invalid_construction : public std::invalid_argument
    177177 {
    @@ -194,14 +194,14 @@
    194194 */
    195195 YB_NORETURN YB_API void
    196196 throw_invalid_construction();
    197-//@}
    197+//!@}
    198198
    199199
    200200 //! \since build 848
    201-//@{
    201+//!@{
    202202 /*!
    203203 \brief 不满足分配器兼容性要求导致的异常。
    204-\sa alloc_rebind_t
    204+\sa rebind_alloc_t
    205205 \see WG21 P0043R0 。
    206206
    207207 兼容的分配器可重绑定不同的类型进行分配。
    @@ -230,15 +230,15 @@
    230230 */
    231231 YB_NORETURN YB_API void
    232232 throw_allocator_mismatch_error();
    233-//@}
    233+//!@}
    234234
    235235
    236236 /*!
    237-\brief 抛出错误: std::system_error 或允许相同构造函数参数的异常。
    237+\brief 抛出错误:\c std::system_error 或允许相同构造函数参数的异常。
    238238 \throw _type 使用参数构造的异常。
    239239 \since build 637
    240240 */
    241-//@{
    241+//!@{
    242242 template<class _type = std::system_error, typename... _tParams>
    243243 YB_NORETURN inline void
    244244 throw_error(std::error_code ec, _tParams&&... args)
    @@ -263,7 +263,7 @@
    263263 {
    264264 throw _type(ev, ecat, yforward(args)...);
    265265 }
    266-//@}
    266+//!@}
    267267
    268268 } // namespace ystdex;
    269269
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/function_adaptor.hpp
    --- a/YBase/include/ystdex/function_adaptor.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/function_adaptor.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2012, 2016, 2018, 2020-2022 FrankHB.
    2+ © 2012, 2016, 2018, 2020-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file function_adaptor.hpp
    1212 \ingroup YStandardEx
    1313 \brief 函数适配器。
    14-\version r5130
    14+\version r5161
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 939
    1717 \par 创建时间:
    1818 2022-02-14 06:37:03 +0800
    1919 \par 修改时间:
    20- 2022-02-15 18:04 +0800
    20+ 2023-12-20 21:58 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -41,7 +41,7 @@
    4141 \brief 更新间接调用对象。
    4242 \note 可配合跳板实现异步调用。
    4343 */
    44-//@{
    44+//!@{
    4545 //! \since build 881
    4646 template<class _tThunk, typename _func>
    4747 inline void
    @@ -55,7 +55,7 @@
    5555 }, std::move(thunk), yforward(f));
    5656 }
    5757 //! \since build 928
    58-//@{
    58+//!@{
    5959 template<class _tThunk, typename _func>
    6060 inline void
    6161 update_thunk(_tThunk& thunk, trivial_swap_t, _func&& f)
    @@ -92,8 +92,8 @@
    9292 cur();
    9393 }, std::move(thunk), yforward(f)));
    9494 }
    95-//@}
    96-//@}
    95+//!@}
    96+//!@}
    9797
    9898
    9999 /*!
    @@ -105,23 +105,22 @@
    105105 \todo 复用静态断言。
    106106 \todo 简化转移实现。
    107107 */
    108-//@{
    109-template<typename _func, typename _tRes = void, typename _tState = bool>
    108+//!@{
    109+template<typename _func, typename _tRes = void, typename _tCond = bool>
    110110 struct one_shot
    111111 {
    112112 static_assert(is_nothrow_move_constructible<_func>(),
    113113 "Invalid target type found.");
    114114 static_assert(is_nothrow_move_constructible<_tRes>(),
    115115 "Invalid result type found.");
    116- static_assert(is_nothrow_swappable<_tState>(),
    117- "Invalid state type found.");
    116+ static_assert(is_nothrow_swappable<_tCond>(), "Invalid state type found.");
    118117
    119118 _func func;
    120119 mutable _tRes result;
    121- mutable _tState fresh{};
    120+ mutable _tCond fresh{};
    122121
    123122 //! \since build 820
    124- template<typename _type, typename _type2 = _tState,
    123+ template<typename _type, typename _type2 = _tCond,
    125124 yimpl(typename = exclude_self_t<one_shot, _type>)>
    126125 one_shot(_type&& f, _tRes r = {}, _type2&& s = {})
    127126 : func(yforward(f)), result(r), fresh(yforward(s))
    @@ -142,8 +141,7 @@
    142141
    143142 template<typename... _tParams>
    144143 yconstfn_relaxed auto
    145- operator()(_tParams&&... args) const
    146- ynoexcept(noexcept(func(yforward(args)...)))
    144+ operator()(_tParams&&... args) const ynoexcept_spec(func(yforward(args)...))
    147145 -> decltype(func(yforward(args)...))
    148146 {
    149147 if(fresh)
    @@ -155,19 +153,19 @@
    155153 }
    156154 };
    157155
    158-template<typename _func, typename _tState>
    159-struct one_shot<_func, void, _tState>
    156+template<typename _func, typename _tCond>
    157+struct one_shot<_func, void, _tCond>
    160158 {
    161159 static_assert(is_nothrow_move_constructible<_func>(),
    162160 "Invalid target type found.");
    163- static_assert(is_nothrow_swappable<_tState>(),
    161+ static_assert(is_nothrow_swappable<_tCond>(),
    164162 "Invalid state type found.");
    165163
    166164 _func func;
    167- mutable _tState fresh{};
    165+ mutable _tCond fresh{};
    168166
    169167 //! \since build 820
    170- template<typename _type, typename _type2 = _tState,
    168+ template<typename _type, typename _type2 = _tCond,
    171169 yimpl(typename = exclude_self_t<one_shot, _type>)>
    172170 one_shot(_type&& f, _type2&& s = {})
    173171 : func(yforward(f)), fresh(yforward(s))
    @@ -188,8 +186,7 @@
    188186
    189187 template<typename... _tParams>
    190188 yconstfn_relaxed void
    191- operator()(_tParams&&... args) const
    192- ynoexcept(noexcept(func(yforward(args)...)))
    189+ operator()(_tParams&&... args) const ynoexcept_spec(func(yforward(args)...))
    193190 {
    194191 if(fresh)
    195192 {
    @@ -216,8 +213,7 @@
    216213
    217214 template<typename... _tParams>
    218215 yconstfn_relaxed auto
    219- operator()(_tParams&&... args) const
    220- ynoexcept(noexcept(func(yforward(args)...)))
    216+ operator()(_tParams&&... args) const ynoexcept_spec(func(yforward(args)...))
    221217 -> decltype(func(yforward(args)...) && noexcept(func = {}))
    222218 {
    223219 if(func)
    @@ -253,29 +249,29 @@
    253249 }
    254250 }
    255251 };
    256-//@}
    252+//!@}
    257253
    258254 /*!
    259255 \relates one_shot
    260256 \since build 926
    261257 */
    262-//@{
    263-template<typename _func, typename _tRes, typename _tState>
    264-struct is_bitwise_swappable<one_shot<_func, _tRes, _tState>>
    258+//!@{
    259+template<typename _func, typename _tRes, typename _tCond>
    260+struct is_bitwise_swappable<one_shot<_func, _tRes, _tCond>>
    265261 : and_<is_bitwise_swappable<_func>, is_bitwise_swappable<_tRes>,
    266- is_bitwise_swappable<_tState>>
    262+ is_bitwise_swappable<_tCond>>
    267263 {};
    268264
    269-template<typename _func, typename _tState>
    270-struct is_bitwise_swappable<one_shot<_func, void, _tState>>
    271- : and_<is_bitwise_swappable<_func>, is_bitwise_swappable<_tState>>
    265+template<typename _func, typename _tCond>
    266+struct is_bitwise_swappable<one_shot<_func, void, _tCond>>
    267+ : and_<is_bitwise_swappable<_func>, is_bitwise_swappable<_tCond>>
    272268 {};
    273269
    274270 template<typename _func, typename _tRes>
    275271 struct is_bitwise_swappable<one_shot<_func, _tRes, void>>
    276272 : and_<is_bitwise_swappable<_func>, is_bitwise_swappable<_tRes>>
    277273 {};
    278-//@}
    274+//!@}
    279275
    280276 } // namespace ystdex;
    281277
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/functional.hpp
    --- a/YBase/include/ystdex/functional.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/functional.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2010-2022 FrankHB.
    2+ © 2010-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file functional.hpp
    1212 \ingroup YStandardEx
    1313 \brief 函数和可调用对象。
    14-\version r5335
    14+\version r5418
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 333
    1717 \par 创建时间:
    1818 2010-08-22 13:04:29 +0800
    1919 \par 修改时间:
    20- 2022-02-15 06:36 +0800
    20+ 2023-12-23 15:28 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -29,13 +29,104 @@
    2929 #define YB_INC_ystdex_functional_hpp_ 1
    3030
    3131 #include "function_adaptor.hpp" // for "invoke.hpp", "ref.hpp", "functor.hpp",
    32-// "bind.hpp", "compose.hpp", "function_adaptor.hpp", <functional>;
    32+// "bind.hpp", "compose.hpp", "function_adaptor.hpp", <functional>,
    33+// exclude_self_t, std::declval, invoke_result_t, is_nothrow_invocable,
    34+// ystdex::invoke, std::forward, is_nothrow_constructible;
    3335 #include "expanded_function.hpp" // for "function.hpp", "expanded_function.hpp";
    3436 #include "hash.hpp" // for "hash.hpp";
    3537
    38+/*!
    39+\brief \c \<functional> 特性测试宏。
    40+\see ISO C++20 [version.syn] 。
    41+\see WG21 P0005R4 。
    42+\see WG21 P0358R1 。
    43+\see WG21 P0941R2 2.2 。
    44+\see https://docs.microsoft.com/cpp/visual-cpp-language-conformance 。
    45+\see https://docs.microsoft.com/cpp/preprocessor/predefined-macros 。
    46+\see https://blogs.msdn.microsoft.com/vcblog/2016/10/11/c1417-features-and-stl-fixes-in-vs-15-preview-5/ 。
    47+\since build 982
    48+*/
    49+//!@{
    50+#ifndef __cpp_lib_not_fn
    51+# if (YB_IMPL_MSCPP >= 1920 && _MSVC_LANG >= 201603L) \
    52+ || __cplusplus >= 201703L
    53+# define __cpp_lib_not_fn 201603L
    54+# endif
    55+#endif
    56+//!@}
    57+
    3658 namespace ystdex
    3759 {
    3860
    61+//! \since build 982
    62+//!@{
    63+//! \warning 非虚析构。
    64+template<typename _func>
    65+class not_fn_t
    66+{
    67+private:
    68+ _func fn;
    69+
    70+public:
    71+ template<typename _tParam,
    72+ yimpl(typename = exclude_self_t<not_fn_t, _tParam>)>
    73+ yconstfn
    74+ not_fn_t(_tParam&& arg)
    75+ : fn(yforward(arg))
    76+ {}
    77+ not_fn_t(const not_fn_t&) = default;
    78+ not_fn_t(not_fn_t&&) = default;
    79+
    80+private:
    81+ template<typename _type>
    82+ static decltype(!std::declval<_type>())
    83+ neg() ynoexcept_spec(!std::declval<_type>());
    84+
    85+#define YB_Impl_functional_not_fn_op(_q) \
    86+ template<typename... _tParams> \
    87+ decltype(neg<invoke_result_t<_func _q, _tParams...>>()) \
    88+ operator()(_tParams&&... args) _q \
    89+ ynoexcept(is_nothrow_invocable<_func _q, _tParams...>() \
    90+ && noexcept(neg<invoke_result_t<_func _q, _tParams...>>())) \
    91+ { \
    92+ return !ystdex::invoke(std::forward<_func _q>(fn), yforward(args)...); \
    93+ }
    94+
    95+ YB_Impl_functional_not_fn_op(&)
    96+ YB_Impl_functional_not_fn_op(const&)
    97+ YB_Impl_functional_not_fn_op(&&)
    98+ YB_Impl_functional_not_fn_op(const&&)
    99+#undef YB_Impl_functional_not_fn_op
    100+};
    101+
    102+
    103+/*!
    104+\see ISO C++17 [func.not.fn] 。
    105+\see WG21 P0005R4 。
    106+\see WG21 P0358R1 。
    107+\see LWG 2767 。
    108+*/
    109+//!@{
    110+inline namespace cpp2017
    111+{
    112+
    113+#if __cpp_lib_not_fn >= 201603L
    114+using std::not_fn;
    115+#else
    116+//! ingroup YBase_replacement_features
    117+template<typename _func>
    118+inline auto
    119+not_fn(_func&& f) ynoexcept(is_nothrow_constructible<decay_t<_func>, _func>())
    120+ -> decltype(yimpl(not_fn_t)<decay_t<_func>>(yforward(f)))
    121+{
    122+ return yimpl(not_fn_t)<decay_t<_func>>(yforward(f));
    123+}
    124+#endif
    125+
    126+} // inline namespace cpp2017;
    127+//!@}
    128+//!@}
    129+
    39130 } // namespace ystdex;
    40131
    41132 #endif
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/placement.hpp
    --- a/YBase/include/ystdex/placement.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/placement.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2015-2016, 2018-2022 FrankHB.
    2+ © 2015-2016, 2018-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file placement.hpp
    1212 \ingroup YStandardEx
    1313 \brief 放置对象管理操作。
    14-\version r1185
    14+\version r1192
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 715
    1717 \par 创建时间:
    1818 2016-08-03 18:56:31 +0800
    1919 \par 修改时间:
    20- 2022-09-07 08:48 +0800
    20+ 2023-12-23 15:35 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -321,7 +321,6 @@
    321321
    322322
    323323 /*!
    324-\tparam _type 构造的对象类型。
    325324 \param obj 构造的存储对象。
    326325 \since build 716
    327326 */
    @@ -356,10 +355,10 @@
    356355 }
    357356 //!@}
    358357
    358+//! \param obj 构造的存储对象。
    359+//!@{
    359360 /*!
    360361 \brief 以默认初始化原地构造。
    361-\tparam _tParams 用于构造对象的参数包类型。
    362-\param args 用于构造对象的参数包。
    363362 \since build 716
    364363 */
    365364 template<typename _type>
    @@ -381,6 +380,7 @@
    381380 {
    382381 yunused(ystdex::construct_within<_type>(obj, yforward(args)...));
    383382 }
    383+//!@}
    384384
    385385 //! \since build 602
    386386 //!@{
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/range.hpp
    --- a/YBase/include/ystdex/range.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/range.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2015-2016, 2018-2022 FrankHB.
    2+ © 2015-2016, 2018-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file range.hpp
    1212 \ingroup YStandardEx
    1313 \brief 范围操作。
    14-\version r1233
    14+\version r1262
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 624
    1717 \par 创建时间:
    1818 2015-08-18 22:33:54 +0800
    1919 \par 修改时间:
    20- 2022-11-21 01:13 +0800
    20+ 2023-12-20 20:52 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -41,45 +41,45 @@
    4141 \see ISO C++20 [version.syn] 。
    4242 \see WG21 P0941R2 2.2 。
    4343 */
    44-//@{
    44+//!@{
    4545 /*!
    4646 \see WG21 P0031R0 。
    4747 \see https://docs.microsoft.com/cpp/preprocessor/predefined-macros 。
    4848 \since build 834
    4949 */
    50-//@{
    50+//!@{
    5151 #ifndef __cpp_lib_array_constexpr
    5252 # if (YB_IMPL_MSCPP >= 1911 && _MSVC_LANG >= 201603L) \
    5353 || __cplusplus >= 201603L
    5454 # define __cpp_lib_array_constexpr 201603L
    5555 # endif
    5656 #endif
    57-//@}
    57+//!@}
    5858 /*!
    5959 \see LWG 2285 。
    6060 \see https://blogs.msdn.microsoft.com/vcblog/2016/01/22/vs-2015-update-2s-stl-is-c17-so-far-feature-complete/ 。
    6161 \since build 832
    6262 */
    63-//@{
    63+//!@{
    6464 #ifndef __cpp_lib_make_reverse_iterator
    6565 # if YB_IMPL_MSCPP >= 1800 || __cplusplus >= 201402L
    6666 # define __cpp_lib_make_reverse_iterator 201210L
    6767 # endif
    6868 #endif
    69-//@}
    69+//!@}
    7070 /*!
    7171 \see WG21 N4280 。
    7272 \see https://docs.microsoft.com/cpp/visual-cpp-language-conformance 。
    7373 \since build 834
    7474 */
    75-//@{
    75+//!@{
    7676 #ifndef __cpp_lib_nonmember_container_access
    7777 # if YB_IMPL_MSCPP >= 1800 || __cplusplus >= 201411L
    7878 # define __cpp_lib_nonmember_container_access 201411L
    7979 # endif
    8080 #endif
    81-//@}
    82-//@}
    81+//!@}
    82+//!@}
    8383
    8484 namespace ystdex
    8585 {
    @@ -251,7 +251,7 @@
    251251 \since build 834
    252252 \see LWG 280 。
    253253 */
    254- //@{
    254+ //!@{
    255255 template<typename _tIter2>
    256256 YB_ATTR_nodiscard YB_PURE friend yconstfn bool
    257257 operator==(const reverse_iterator& x, const reverse_iterator<_tIter2>& y)
    @@ -293,7 +293,7 @@
    293293 {
    294294 return x.current >= y.current;
    295295 }
    296- //@}
    296+ //!@}
    297297
    298298 YB_ATTR_nodiscard YB_PURE friend yconstfn reverse_iterator
    299299 operator+(difference_type n, const reverse_iterator& x)
    @@ -379,7 +379,7 @@
    379379 \ingroup YBase_replacement_features
    380380 \since build 833
    381381 */
    382-//@{
    382+//!@{
    383383 //! \since build 664
    384384 template<typename _type, size_t _vN>
    385385 YB_ATTR_nodiscard YB_PURE yconstfn _type*
    @@ -409,14 +409,14 @@
    409409 {
    410410 return reverse_iterator<_type*>(array);
    411411 }
    412-//@}
    412+//!@}
    413413
    414414 //! \since build 834
    415415 inline namespace cpp2017
    416416 {
    417417
    418418 //! \since build 624
    419-//@{
    419+//!@{
    420420 // XXX: To prevent introduce non-'constexpr' version of %std::(begin, end),
    421421 // %__cpp_lib_array_constexpr is also checked, even the direct interface is not
    422422 // changed from the original version in ISO C++14.
    @@ -433,7 +433,7 @@
    433433 using std::crend;
    434434 #else
    435435 //! \since build 938
    436-//@{
    436+//!@{
    437437 template<typename _tRange, YB_Impl_Range_DisambiguousParams>
    438438 YB_ATTR_nodiscard YB_PURE yconstfn auto
    439439 cbegin(const _tRange& c, YB_Impl_Range_DisambiguousArgs)
    @@ -462,7 +462,7 @@
    462462 {
    463463 return c.rbegin();
    464464 }
    465-//@}
    465+//!@}
    466466 //! \since build 833
    467467 template<typename _type, size_t _vN>
    468468 YB_ATTR_nodiscard YB_PURE yconstfn reverse_iterator<_type*>
    @@ -510,7 +510,8 @@
    510510 //! \since build 938
    511511 template<typename _tRange, YB_Impl_Range_DisambiguousParams>
    512512 YB_ATTR_nodiscard YB_PURE yconstfn auto
    513-crbegin(const _tRange& c, YB_Impl_Range_DisambiguousArgs) -> decltype(ystdex::rbegin(c))
    513+crbegin(const _tRange& c, YB_Impl_Range_DisambiguousArgs)
    514+ -> decltype(ystdex::rbegin(c))
    514515 {
    515516 return ystdex::rbegin(c);
    516517 }
    @@ -518,12 +519,13 @@
    518519 //! \since build 938
    519520 template<typename _tRange, YB_Impl_Range_DisambiguousParams>
    520521 YB_ATTR_nodiscard YB_PURE yconstfn auto
    521-crend(const _tRange& c, YB_Impl_Range_DisambiguousArgs) -> decltype(ystdex::rend(c))
    522+crend(const _tRange& c, YB_Impl_Range_DisambiguousArgs)
    523+ -> decltype(ystdex::rend(c))
    522524 {
    523525 return ystdex::rend(c);
    524526 }
    525527 #endif
    526-//@}
    528+//!@}
    527529
    528530 #undef YB_Impl_Range_DisambiguousArgs
    529531 #undef YB_Impl_Range_DisambiguousParams
    @@ -543,7 +545,7 @@
    543545 所以不能帮助推导需要常量访问初值符列表的情形。
    544546 因此,在此提供扩展,以允许和其它方式相同的方式直接以初值符调用这些访问函数模板。
    545547 */
    546-//@{
    548+//!@{
    547549 template<typename _tElem>
    548550 YB_ATTR_nodiscard YB_PURE yconstfn const _tElem*
    549551 cbegin(std::initializer_list<_tElem> il) ynothrow
    @@ -573,7 +575,7 @@
    573575 {
    574576 return ystdex::rend(il);
    575577 }
    576-//@}
    578+//!@}
    577579
    578580 /*!
    579581 \brief 类容器访问。
    @@ -581,7 +583,7 @@
    581583 \see ISO C++17 [iterator.container] 。
    582584 \since build 663
    583585 */
    584-//@{
    586+//!@{
    585587 //! \since build 834
    586588 inline namespace cpp2017
    587589 {
    @@ -667,20 +669,20 @@
    667669 {
    668670 return array;
    669671 }
    670-//@}
    672+//!@}
    671673
    672674 /*!
    673675 \ingroup metafunctions
    674676 \since build 899
    675677 */
    676-//@{
    678+//!@{
    677679 template<typename _tRange>
    678680 using range_iterator_t = decltype(ystdex::begin(std::declval<_tRange&>()));
    679681
    680682 template<typename _tRange>
    681683 using range_const_iterator_t
    682684 = decltype(ystdex::cbegin(std::declval<const _tRange&>()));
    683-//@}
    685+//!@}
    684686
    685687 //! \since build 546
    686688 namespace details
    @@ -720,7 +722,7 @@
    720722 若可调用结果可转换为 size_t 的 ADL 函数 size 则使用 ADL size ;
    721723 否则使用 std::distance 计算范围迭代器确定范围大小。
    722724 */
    723-//@{
    725+//!@{
    724726 template<typename _tRange>
    725727 yconstfn auto
    726728 range_size(const _tRange& c)
    @@ -734,7 +736,7 @@
    734736 {
    735737 return size(il);
    736738 }
    737-//@}
    739+//!@}
    738740
    739741 } // namespace ystdex;
    740742
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/rational.hpp
    --- a/YBase/include/ystdex/rational.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/rational.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2011-2017, 2019, 2021-2022 FrankHB.
    2+ © 2011-2017, 2019, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file rational.hpp
    1212 \ingroup YStandardEx
    1313 \brief 有理数运算。
    14-\version r2267
    14+\version r2308
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 260
    1717 \par 创建时间:
    1818 2011-11-12 23:23:47 +0800
    1919 \par 修改时间:
    20- 2022-01-21 20:45 +0805
    20+ 2023-12-20 20:36 +0805
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -38,11 +38,11 @@
    3838 {
    3939
    4040 //! \since build 588
    41-//@{
    41+//!@{
    4242 //! \brief 判断指定的值是否为零值。
    43-//@{
    43+//!@{
    4444 template<typename _type>
    45-yconstfn yimpl(enable_if_t)<is_floating_point<_type>::value, bool>
    45+yconstfn yimpl(enable_if_t)<is_floating_point<_type>{}, bool>
    4646 is_zero(_type x)
    4747 {
    4848 return std::fpclassify(x) == FP_ZERO;
    @@ -54,7 +54,7 @@
    5454 {
    5555 return x == _type(0);
    5656 }
    57-//@}
    57+//!@}
    5858
    5959
    6060 /*!
    @@ -62,7 +62,7 @@
    6262 \pre 参数为有限值。
    6363 \warning 不检查参数。
    6464 */
    65-//@{
    65+//!@{
    6666 /*!
    6767 \note 不检查误差非零。
    6868 \note 使用 ADL round 。
    @@ -82,7 +82,7 @@
    8282 {
    8383 return ystdex::is_zero(err) ? x : ystdex::round_in_nocheck(x, err);
    8484 }
    85-//@}
    85+//!@}
    8686
    8787
    8888 //! \brief 计算整数次幂。
    @@ -117,7 +117,7 @@
    117117 {
    118118 return ystdex::square(ystdex::square(x));
    119119 }
    120-//@}
    120+//!@}
    121121
    122122
    123123 /*!
    @@ -145,12 +145,12 @@
    145145
    146146 基于整数算术实现的确定有限精度二进制定点小数类型。可用于替换内建的浮点数类型。
    147147 是否有符号同基本整数类型参数。若有符号,则最高有效位为符号位。
    148-逻辑布局: [符号位]|整数部分|小数部分 。各个部分的内部为补码表示。
    148+逻辑布局:[符号位]|整数部分|小数部分 。各个部分的内部为补码表示。
    149149 \tparam _tBase 基本整数类型。
    150150 \tparam _vInt 整数部分(若有符号则不包括符号位,下同)二进制位数。
    151151 \tparam _vFrac 分数部分二进制位数。
    152152 \note 默认保留 6 位二进制小数。
    153-\note 部分实现参考: http://www.codeproject.com/KB/cpp/fp_math.aspx 。
    153+\note 部分实现参考:http://www.codeproject.com/KB/cpp/fp_math.aspx 。
    154154 \warning 基本整数类型需要具有补码表示。
    155155 \warning 非虚析构。
    156156 \warning 算术运算可能溢出。
    @@ -201,36 +201,36 @@
    201201 template<typename _tInt>
    202202 yconstfn
    203203 fixed_point(_tInt val,
    204- yimpl(enable_if_t<is_integral<_tInt>::value, _tInt*> = {})) ynothrowv
    204+ yimpl(enable_if_t<is_integral<_tInt>{}, _tInt*> = {})) ynothrowv
    205205 // XXX: Conversion to 'base_type' might be implementation-defined if
    206206 // it is signed.
    207207 : value(base_type(val << frac_bit_n))
    208208 {}
    209209 //! \since build 581
    210- //@{
    210+ //!@{
    211211 template<typename _tFloat>
    212212 explicit yconstfn
    213- fixed_point(_tFloat val, yimpl(enable_if_t<
    214- is_floating_point<_tFloat>::value, _tFloat*> = {})) ynothrow
    213+ fixed_point(_tFloat val, yimpl(
    214+ enable_if_t<is_floating_point<_tFloat>{}, _tFloat*> = {})) ynothrow
    215215 : value(base_type(std::llround(base_element() * val)))
    216216 {}
    217217 template<typename _tFirst, typename _tSecond>
    218218 //! \since build 595
    219- //@{
    219+ //!@{
    220220 yconstfn
    221221 fixed_point(_tFirst x, _tSecond y, yimpl(enable_if_t<and_<is_integral<
    222- _tFirst>, not_<is_same<_tSecond, raw_tag>>>::value, _tFirst*> = {}))
    222+ _tFirst>, not_<is_same<_tSecond, raw_tag>>>{}, _tFirst*> = {}))
    223223 ynothrowv
    224224 : value((x << frac_bit_n) / y)
    225225 {}
    226226 template<typename _tFirst, typename _tSecond>
    227227 explicit yconstfn
    228228 fixed_point(_tFirst x, _tSecond y, yimpl(enable_if_t<and_<is_floating_point<
    229- _tFirst>, not_<is_same<_tSecond, raw_tag>>>::value, _tFirst*> = {}))
    229+ _tFirst>, not_<is_same<_tSecond, raw_tag>>>{}, _tFirst*> = {}))
    230230 ynothrowv
    231231 : fixed_point(x / y)
    232232 {}
    233- //@}
    233+ //!@}
    234234 //! \since build 260
    235235 yconstfn
    236236 fixed_point(const fixed_point&) = default;
    @@ -267,7 +267,7 @@
    267267 ynothrow
    268268 : value(f.value << (frac_bit_n - _vOtherFrac))
    269269 {}
    270- //@}
    270+ //!@}
    271271
    272272 //! \since build 586
    273273 fixed_point&
    @@ -316,7 +316,7 @@
    316316 }
    317317
    318318 //! \since build 595
    319- //@{
    319+ //!@{
    320320 fixed_point&
    321321 operator++() ynothrowv
    322322 {
    @@ -348,7 +348,7 @@
    348348 fixed_point&
    349349 operator*=(const fixed_point& f) ynothrowv
    350350 {
    351- value = mul<frac_bit_n + is_signed<base_type>::value>(value,
    351+ value = mul<frac_bit_n + is_signed<base_type>()>(value,
    352352 f.value, is_signed<typename make_widen_int<base_type>::type>());
    353353 return *this;
    354354 }
    @@ -362,7 +362,7 @@
    362362 / f.value);
    363363 return *this;
    364364 }
    365- //@}
    365+ //!@}
    366366
    367367 fixed_point&
    368368 operator>>=(size_t s) ynothrow
    @@ -380,22 +380,22 @@
    380380 }
    381381
    382382 //! \since build 581
    383- //@{
    383+ //!@{
    384384 template<typename _type,
    385- yimpl(typename = enable_if_t<is_integral<_type>::value>)>
    385+ yimpl(typename = enable_if_t<is_integral<_type>{}>)>
    386386 explicit yconstfn
    387387 operator _type() const ynothrow
    388388 {
    389389 return _type(value >> base_type(frac_bit_n));
    390390 }
    391391 template<typename _type, yimpl(typename _type2 = _type,
    392- typename = enable_if_t<is_floating_point<_type2>::value>)>
    392+ typename = enable_if_t<is_floating_point<_type2>{}>)>
    393393 yconstfn
    394394 operator _type() const ynothrow
    395395 {
    396396 return _type(value) / base_element();
    397397 }
    398- //@}
    398+ //!@}
    399399
    400400 //! \since build 717
    401401 friend yconstfn fixed_point
    @@ -513,7 +513,7 @@
    513513 // because name lookup cannot find both in-class and out-of-class declarations
    514514 // without ambiguity.
    515515 //! \relates fixed_point
    516-//@{
    516+//!@{
    517517 #define YB_Impl_Rational_fp_TmplHead_2 \
    518518 template<YB_Impl_Rational_fp_PList1, YB_Impl_Rational_fp_PList2>
    519519 #define YB_Impl_Rational_fp_TmplHead_2_l \
    @@ -539,7 +539,7 @@
    539539 \brief 不同模板参数的二元算术操作符。
    540540 \since build 439
    541541 */
    542-//@{
    542+//!@{
    543543 #define YB_Impl_Rational_fp_arithmetic2(_op) \
    544544 YB_Impl_Rational_fp_TmplHead_2 \
    545545 yconstfn common_type_t<YB_Impl_Rational_fp_T1, YB_Impl_Rational_fp_T2> \
    @@ -547,13 +547,13 @@
    547547 YB_Impl_Rational_fp_TmplBody_Impl_2(_op) \
    548548 \
    549549 YB_Impl_Rational_fp_TmplHead_2_l \
    550- yconstfn enable_if_t<is_arithmetic<_type>::value, \
    550+ yconstfn enable_if_t<is_arithmetic<_type>{}, \
    551551 common_type_t<YB_Impl_Rational_fp_T, _type>> \
    552552 YB_Impl_Rational_fp_TmplSig_2_l(_op) \
    553553 YB_Impl_Rational_fp_TmplBody_Impl_2(_op) \
    554554 \
    555555 YB_Impl_Rational_fp_TmplHead_2_r \
    556- yconstfn enable_if_t<is_arithmetic<_type>::value, \
    556+ yconstfn enable_if_t<is_arithmetic<_type>{}, \
    557557 common_type_t<_type, YB_Impl_Rational_fp_T>> \
    558558 YB_Impl_Rational_fp_TmplSig_2_r(_op) \
    559559 YB_Impl_Rational_fp_TmplBody_Impl_2(_op)
    @@ -564,13 +564,13 @@
    564564 YB_Impl_Rational_fp_arithmetic2(/)
    565565
    566566 #undef YB_Impl_Rational_fp_ar2
    567-//@}
    567+//!@}
    568568
    569569 /*!
    570570 \brief 不同模板参数的二元关系操作符。
    571571 \since build 440
    572572 */
    573-//@{
    573+//!@{
    574574 #define YB_Impl_Rational_fp_rational2(_op) \
    575575 YB_Impl_Rational_fp_TmplHead_2 \
    576576 yconstfn bool \
    @@ -595,7 +595,7 @@
    595595 YB_Impl_Rational_fp_rational2(>=)
    596596
    597597 #undef YB_Impl_Rational_fp_rational2
    598-//@}
    598+//!@}
    599599
    600600 #undef YB_Impl_Rational_fp_TmplSig_2_r
    601601 #undef YB_Impl_Rational_fp_TmplSig_2_l
    @@ -643,7 +643,7 @@
    643643 using make_fixed_t = fixed_point<conditional_t<_bSigned,
    644644 typename make_width_int<_vFrac + _vInt>::least_type,
    645645 typename make_width_int<_vFrac + _vInt>::unsigned_least_type>, _vFrac>;
    646-//@}
    646+//!@}
    647647
    648648 } // namespace ystdex;
    649649
    @@ -651,7 +651,7 @@
    651651 {
    652652
    653653 //! \relates ystdex::fixed_point
    654-//@{
    654+//!@{
    655655 /*!
    656656 \brief std::common_type 的 ystdex::fixed_point 特化类型。
    657657 \note 使用保留公共整数类型和整数位数策略选取公共类型。
    @@ -679,7 +679,7 @@
    679679 当其它类型是浮点数时即为公共类型,
    680680 否则 ystdex::fixed_point 的实例为公共类型。
    681681 */
    682-//@{
    682+//!@{
    683683 template<YB_Impl_Rational_fp_PList, typename _type>
    684684 struct common_type<ystdex::YB_Impl_Rational_fp_T, _type>
    685685 {
    @@ -702,10 +702,11 @@
    702702 {
    703703 using type = ystdex::common_type_t<ystdex::YB_Impl_Rational_fp_T, _type>;
    704704 };
    705-//@}
    705+//!@}
    706706
    707707
    708708 /*!
    709+\ingroup hashers
    709710 \brief ystdex::fixed_point 散列支持。
    710711 \since build 590
    711712 */
    @@ -828,7 +829,7 @@
    828829 \see LWG 559 。
    829830 \since build 668
    830831 */
    831-//@{
    832+//!@{
    832833 // XXX: The resolution of LWG 559 added the requirement to the standard
    833834 // specializations and the synopsis to ensure cv-qualified types, but there are
    834835 // no rules to require such standard specializations working with
    @@ -851,8 +852,8 @@
    851852 class numeric_limits<const volatile ystdex::YB_Impl_Rational_fp_T>
    852853 : yimpl(public) numeric_limits<ystdex::YB_Impl_Rational_fp_T>
    853854 {};
    854-//@}
    855-//@}
    855+//!@}
    856+//!@}
    856857
    857858 #undef YB_Impl_Rational_fp_PList2
    858859 #undef YB_Impl_Rational_fp_PList1
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/ref.hpp
    --- a/YBase/include/ystdex/ref.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/ref.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2011-2016, 2018-2022 FrankHB.
    2+ © 2011-2016, 2018-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file ref.hpp
    1212 \ingroup YStandardEx
    1313 \brief 引用包装。
    14-\version r530
    14+\version r548
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 588
    1717 \par 创建时间:
    1818 2015-03-28 22:29:20 +0800
    1919 \par 修改时间:
    20- 2022-02-07 23:09 +0800
    20+ 2023-12-20 20:59 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -43,7 +43,7 @@
    4343 {
    4444
    4545 //! \since build 554
    46-//@{
    46+//!@{
    4747 /*!
    4848 \brief 左值引用包装。
    4949 \tparam _type 被包装的类型。
    @@ -63,7 +63,7 @@
    6363 以允许具有引用包装值实例作为成员的类能在 ISO C++11 保证启用空基类优化;
    6464 相关规则另见 Base 模块的说明。
    6565 */
    66-//@{
    66+//!@{
    6767 template<typename _type>
    6868 class lref
    6969 {
    @@ -74,7 +74,7 @@
    7474 _type* ptr;
    7575
    7676 //! \since build 870
    77- //@{
    77+ //!@{
    7878 static yconstfn _type*
    7979 fun(_type&) ynothrow;
    8080 static yconstfn _type*
    @@ -86,7 +86,7 @@
    8686 lref(_type2&& u) ynoexcept(yimpl(noexcept(fun(std::declval<_type2>()))))
    8787 : ptr(ystdex::addressof(static_cast<_type&>(std::forward<_type2>(u))))
    8888 {}
    89- //@}
    89+ //!@}
    9090 //! \since build 556
    9191 lref(const lref&) = default;
    9292
    @@ -122,7 +122,7 @@
    122122 \brief 构造引用包装。
    123123 \relates lref
    124124 */
    125-//@{
    125+//!@{
    126126 template<typename _type>
    127127 yconstfn lref<_type>
    128128 ref(_type& t)
    @@ -142,8 +142,8 @@
    142142 template<class _type>
    143143 void
    144144 cref(const _type&&) = delete;
    145-//@}
    146-//@}
    145+//!@}
    146+//!@}
    147147
    148148
    149149 /*!
    @@ -152,7 +152,7 @@
    152152 \note 接口含义类似 boost::is_reference_wrapper 。
    153153 \since build 675
    154154 */
    155-//@{
    155+//!@{
    156156 template<typename _type>
    157157 struct is_reference_wrapper : false_
    158158 {};
    @@ -164,7 +164,7 @@
    164164 template<typename _type>
    165165 struct is_reference_wrapper<lref<_type>> : true_
    166166 {};
    167-//@}
    167+//!@}
    168168
    169169 /*!
    170170 \ingroup transformation_traits
    @@ -172,14 +172,14 @@
    172172 \see WG21 P0318R1 。
    173173 \see LWG 3202 。
    174174 */
    175-//@{
    175+//!@{
    176176 /*!
    177177 \brief 取引用包装的类型或未被包装的模板参数类型。
    178178 \note 含义类似 boost 和 std 中的同名接口。
    179179 \note YStandardEx 扩展:支持 lref 的实例。
    180180 \since build 675
    181181 */
    182-//@{
    182+//!@{
    183183 template<typename _type>
    184184 struct unwrap_reference
    185185 {
    @@ -200,19 +200,19 @@
    200200 {
    201201 using type = _type&;
    202202 };
    203-//@}
    203+//!@}
    204204
    205205
    206206 //! \since build 850
    207-//@{
    207+//!@{
    208208 template<typename _type>
    209209 struct unwrap_ref_decay : unwrap_reference<decay_t<_type>>
    210210 {};
    211211
    212212 template<typename _type>
    213213 using unwrap_ref_decay_t = _t<unwrap_ref_decay<_type>>;
    214-//@}
    215-//@}
    214+//!@}
    215+//!@}
    216216
    217217
    218218 /*!
    @@ -248,7 +248,7 @@
    248248 \note 默认仅提供对 std::reference_wrapper 和 lref 的实例类型的重载。
    249249 \since build 348
    250250 */
    251-//@{
    251+//!@{
    252252 template<typename _type>
    253253 yconstfn _type&
    254254 unref(_type&& x) ynothrow
    @@ -269,7 +269,7 @@
    269269 {
    270270 return x.get();
    271271 }
    272-//@}
    272+//!@}
    273273
    274274
    275275 /*!
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/tuple.hpp
    --- a/YBase/include/ystdex/tuple.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/tuple.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2013-2016, 2018-2019, 2022 FrankHB.
    2+ © 2013-2016, 2018-2019, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file tuple.hpp
    1212 \ingroup YStandardEx
    1313 \brief 元组类型和操作。
    14-\version r917
    14+\version r928
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 333
    1717 \par 创建时间:
    1818 2013-09-24 22:29:55 +0800
    1919 \par 修改时间:
    20- 2022-10-15 05:38 +0800
    20+ 2023-12-20 20:37 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -42,20 +42,20 @@
    4242 \ingroup transformation_traits
    4343 \since build 477
    4444 */
    45-//@{
    45+//!@{
    4646 #if __cpp_lib_tuple_element_t >= 201402L
    4747 using std::tuple_element_t;
    4848 #else
    4949 template<size_t _vIdx, typename _type>
    5050 using tuple_element_t = _t<std::tuple_element<_vIdx, _type>>;
    5151 #endif
    52-//@}
    52+//!@}
    5353
    5454 } // inline namespace cpp2014;
    5555
    5656
    5757 //! \since build 589
    58-//@{
    58+//!@{
    5959 namespace vseq
    6060 {
    6161
    @@ -92,7 +92,7 @@
    9292 };
    9393
    9494 } // namespace vseq;
    95-//@}
    95+//!@}
    9696
    9797
    9898 /*!
    @@ -101,7 +101,7 @@
    101101 \since build 651
    102102 \todo 重命名为 \c variant_npos ,转移到合适的头文件。
    103103 */
    104-//@{
    104+//!@{
    105105 //! \brief 表示没有找到的索引。
    106106 static yconstexpr const auto tuple_not_found(size_t(-1));
    107107
    @@ -110,8 +110,7 @@
    110110 {
    111111
    112112 template<class _tSize, class _tIndex>
    113-using index_conv = size_t_<_tSize::value == _tIndex::value
    114- ? tuple_not_found : _tIndex::value>;
    113+using index_conv = size_t_<_tSize() == _tIndex() ? tuple_not_found : _tIndex()>;
    115114
    116115 } // namespace details;
    117116
    @@ -120,7 +119,7 @@
    120119 \brief 查找类型对应的索引位置,若不存在则为 tuple_not_found 。
    121120 \sa tuple_not_found
    122121 */
    123-//@{
    122+//!@{
    124123 template<typename, class>
    125124 struct tuple_find;
    126125
    @@ -146,8 +145,8 @@
    146145 struct tuple_find<_type, std::pair<_type1, _type2>>
    147146 : tuple_find<_type, std::tuple<_type1, _type2>>
    148147 {};
    149-//@}
    150-//@}
    148+//!@}
    149+//!@}
    151150
    152151 } // namespace ystdex;
    153152
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ystdex/typeindex.h
    --- a/YBase/include/ystdex/typeindex.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ystdex/typeindex.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2020-2021 FrankHB.
    2+ © 2020-2021, 2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file typeindex.h
    1212 \ingroup YStandardEx
    1313 \brief ISO C++ 类型索引扩展。
    14-\version r112
    14+\version r116
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 892
    1717 \par 创建时间:
    1818 2020-06-12 20:28:55 +0800
    1919 \par 修改时间:
    20- 2021-12-29 01:17 +0800
    20+ 2023-12-20 20:48 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -37,7 +37,7 @@
    3737 {
    3838
    3939 //! \since build 892
    40-//@{
    40+//!@{
    4141 /*!
    4242 \brief 类型索引。
    4343 \note 类似 std::type_index ,但包装 type_id_info 而不是 std::type_info 。
    @@ -84,7 +84,7 @@
    8484 #else
    8585 using std::type_index;
    8686 #endif
    87-//@}
    87+//!@}
    8888
    8989 } // namespace ystdex;
    9090
    @@ -92,6 +92,7 @@
    9292 {
    9393
    9494 /*!
    95+\ingroup hashers
    9596 \brief ystdex::type_id_info 散列支持。
    9697 \since build 892
    9798 */
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/include/ytest/timing.hpp
    --- a/YBase/include/ytest/timing.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/include/ytest/timing.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2012-2014 FrankHB.
    2+ © 2012-2014, 2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file timing.hpp
    1212 \ingroup YTest
    1313 \brief 运行计时测试工具。
    14-\version r338
    14+\version r340
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 308
    1717 \par 创建时间:
    1818 2012-06-23 20:01:09 +0800
    1919 \par 修改时间:
    20- 2014-10-04 15:10 +0800
    20+ 2023-12-25 23:59 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -28,7 +28,7 @@
    2828 #ifndef YB_INC_ytest_timing_hpp_
    2929 #define YB_INC_ytest_timing_hpp_ 1
    3030
    31-#include "../ydef.h"
    31+#include <ystdex/cstddef.h> // for ystdex::size_t;
    3232 #include <ctime>
    3333
    3434 /*!
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YBase/source/ystdex/node_base.cpp
    --- a/YBase/source/ystdex/node_base.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YBase/source/ystdex/node_base.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2019, 2022 FrankHB.
    2+ © 2019, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file node_base.cpp
    1212 \ingroup YStandardEx
    1313 \brief 作为节点序列容器实现的节点基础。
    14-\version r176
    14+\version r197
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 865
    1717 \par 创建时间:
    1818 2019-08-22 17:48:43 +0800
    1919 \par 修改时间:
    20- 2022-11-28 19:55 +0800
    20+ 2023-12-23 15:51 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -43,33 +43,19 @@
    4343 {
    4444 std::swap(x.next, y.next),
    4545 std::swap(x.prev, y.prev);
    46- yunseq(
    47- x.next->prev = x.prev->next = &x,
    48- y.next->prev = y.prev->next = &y
    49- );
    46+ yunseq(x.next->prev = x.prev->next = &x,
    47+ y.next->prev = y.prev->next = &y);
    5048 }
    5149 else
    5250 {
    53- yunseq(
    54- y.next = x.next,
    55- y.prev = x.prev
    56- );
    57- yunseq(
    58- y.next->prev = y.prev->next = &y,
    59- x.next = x.prev = &x
    60- );
    51+ yunseq(y.next = x.next, y.prev = x.prev);
    52+ yunseq(y.next->prev = y.prev->next = &y, x.next = &x, x.prev = &x);
    6153 }
    6254 }
    6355 else if(y.next != &y)
    6456 {
    65- yunseq(
    66- x.next = y.next,
    67- x.prev = y.prev
    68- );
    69- yunseq(
    70- x.next->prev = x.prev->next = &x,
    71- y.next = y.prev = &y
    72- );
    57+ yunseq(x.next = y.next, x.prev = y.prev);
    58+ yunseq(x.next->prev = x.prev->next = &x, y.next = &y, y.prev = &y);
    7359 }
    7460 }
    7561
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/DS/include/YCLib/DSIO.h
    --- a/YFramework/DS/include/YCLib/DSIO.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/DS/include/YCLib/DSIO.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2011-2021, 2023 FrankHB.
    2+ © 2011-2021, 2023-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -12,13 +12,13 @@
    1212 \ingroup YCLib
    1313 \ingroup DS
    1414 \brief DS 底层输入输出接口。
    15-\version r1711
    15+\version r1715
    1616 \author FrankHB <frankhb1989@gmail.com>
    1717 \since build 604
    1818 \par 创建时间:
    1919 2015-06-06 03:01:27 +0800
    2020 \par 修改时间:
    21- 2023-05-04 02:46 +0800
    21+ 2024-02-26 01:15 +0800
    2222 \par 文本编码:
    2323 UTF-8
    2424 \par 模块名称:
    @@ -30,11 +30,11 @@
    3030 #define YCL_DS_INC_DSIO_h_ 1
    3131
    3232 #include "YCLib/YModules.h"
    33-#include YFM_YCLib_YCommon // for size_t;
    33+#include YFM_YCLib_Platform
    3434 #if YCL_DS
    35+# include YFM_YCLib_Basic // for size_t, noncopyable, nonmovable;
    3536 # include YFM_YCLib_Reference // for lref;
    3637 # include <nds/disc_io.h> // for ::DISC_INTERFACE, ::sec_t;
    37-# include <ystdex/base.h> // for ystdex::noncopyable, ystdex::nonmomable;
    3838 # include <ystdex/cache.hpp> // for ystdex::used_list_cache;
    3939 # include <ystdex/cstdio.h> //for ystdex::block_buffer;
    4040 # include YFM_YCLib_FileSystem // for platform::FAT, platform::Deref,
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/DS/source/Helper/DSMain.cpp
    --- a/YFramework/DS/source/Helper/DSMain.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/DS/source/Helper/DSMain.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2010-2017, 2021-2022 FrankHB.
    2+ © 2010-2017, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -12,13 +12,13 @@
    1212 \ingroup Helper
    1313 \ingroup DS
    1414 \brief DS 平台框架。
    15-\version r3243
    15+\version r3246
    1616 \author FrankHB <frankhb1989@gmail.com>
    1717 \since build 296
    1818 \par 创建时间:
    1919 2012-03-25 12:48:49 +0800
    2020 \par 修改时间:
    21- 2022-09-03 22:31 +0800
    21+ 2023-12-23 15:59 +0800
    2222 \par 文本编码:
    2323 UTF-8
    2424 \par 模块名称:
    @@ -53,7 +53,8 @@
    5353 {
    5454
    5555 #if YCL_Win32
    56-yconstexpr const double g_max_free_fps(1000);
    56+//! \since build 982
    57+yconstexpr const uint16_t g_max_free_fps(1000);
    5758 std::chrono::nanoseconds host_sleep(std::uint64_t(1000000000 / g_max_free_fps));
    5859 #endif
    5960
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/DS/source/YCLib/DSIO.cpp
    --- a/YFramework/DS/source/YCLib/DSIO.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/DS/source/YCLib/DSIO.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2015-2022 FrankHB.
    2+ © 2015-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -12,13 +12,13 @@
    1212 \ingroup YCLib
    1313 \ingroup DS
    1414 \brief DS 底层输入输出接口。
    15-\version r4952
    15+\version r4973
    1616 \author FrankHB <frankhb1989@gmail.com>
    1717 \since build 604
    1818 \par 创建时间:
    1919 2015-06-06 06:25:00 +0800
    2020 \par 修改时间:
    21- 2022-11-28 19:57 +0800
    21+ 2023-12-20 20:30 +0800
    2222 \par 文本编码:
    2323 UTF-8
    2424 \par 模块名称:
    @@ -27,7 +27,8 @@
    2727
    2828
    2929 #include "YCLib/YModules.h"
    30-#include YFM_DS_YCLib_DSIO // for platform::Descriptions, std::runtime_error,
    30+#include YFM_DS_YCLib_DSIO
    31+#include YFM_YCLib_YCommon // for platform::Descriptions, std::runtime_error,
    3132 // ystdex::throw_error, std::system_error, string, string_view,
    3233 // ystdex::exchange, ystdex::retry_on_cond, YAssertNonnull, FetchSeparator,
    3334 // ystdex::id, std::bind, std::placeholder::_1, ystdex::is_parent_or_self,
    @@ -210,18 +211,18 @@
    210211 {
    211212
    212213 //! \since build 610
    213-//@{
    214+//!@{
    214215 // TODO: Support big endian implementations.
    215216 using ystdex::read_uint_le;
    216217 using ystdex::write_uint_le;
    217218 using ystdex::throw_error;
    218219 //! \since build 611
    219-//@{
    220+//!@{
    220221 using std::system_error;
    221222 using std::errc;
    222223 // XXX: Coupled string types.
    223224 using CHRLib::MakeUCS2LE;
    224-//@}
    225+//!@}
    225226
    226227 namespace
    227228 {
    @@ -258,7 +259,7 @@
    258259
    259260
    260261 //! \since build 611
    261-//@{
    262+//!@{
    262263 void
    263264 CheckThrowEIO(bool b) ythrow(system_error)
    264265 {
    @@ -280,10 +281,10 @@
    280281 {
    281282 return tbl.ClusterToSector(pos.GetCluster()) + pos.GetSector();
    282283 }
    283-//@}
    284+//!@}
    284285
    285286 //! \since build 713
    286-//@{
    287+//!@{
    287288 PDefH(void, CheckFillPartialSectorOff, const AllocationTable& tbl,
    288289 const FilePosition& pos, size_t offset, size_t n) ythrow(system_error)
    289290 ImplExpr(CheckThrowEIO(
    @@ -346,7 +347,7 @@
    346347 PDefH(void, CheckWriteSectors, const AllocationTable& tbl, const FilePosition&
    347348 pos, const void* buf, size_t n) ythrow(system_error)
    348349 ImplRet(CheckThrowEIO(tbl.Cache.WriteSectors(PosToSec(tbl, pos), buf, n)))
    349-//@}
    350+//!@}
    350351
    351352 //! \since build 656
    352353 YB_ATTR_nodiscard bool
    @@ -380,7 +381,7 @@
    380381 }
    381382
    382383 } // unnamed namespace;
    383-//@}
    384+//!@}
    384385
    385386 AllocationTable::AllocationTable(::sec_t start_sector, const byte* sec_buf,
    386387 size_t pages, size_t sectors_per_page_shift, Disc d)
    @@ -1508,6 +1509,12 @@
    15081509 st.st_atime = ConvertFileTime(read_uint_le<16>(dst + EntryData::ADate), 0),
    15091510 st.st_mtime = ConvertFileTime(read_uint_le<16>(
    15101511 dst + EntryData::MDate), read_uint_le<16>(dst + EntryData::MTime)),
    1512+ // XXX: As libfat, ctime is reused as creation time, as no event to change
    1513+ // POSIX ctime is supported by FAT except the change of the file content
    1514+ // which is covered by mtime, so there is no clash. The meaning is
    1515+ // different in POSIX's %::stat, though. It is also different to Win32
    1516+ // UCRT where mtime is synomym to ctime even for NTFS which has metadata
    1517+ // change events.
    15111518 st.st_ctime = ConvertFileTime(read_uint_le<16>(
    15121519 dst + EntryData::CDate), read_uint_le<16>(dst + EntryData::CTime)),
    15131520 // XXX: See https://github.com/devkitPro/newlib/commit/72ff9acad2ab54e80a19ddaec0106065c817e3f6
    @@ -2200,7 +2207,7 @@
    22002207 using fres_t = decltype(f());
    22012208 using res_t = ystdex::nonvoid_result_t<fres_t, int>;
    22022209 static yconstexpr const auto
    2203- de_val(std::is_pointer<fres_t>::value ? res_t() : res_t(-1));
    2210+ de_val(std::is_pointer<fres_t>() ? res_t() : res_t(-1));
    22042211
    22052212 TryRet(ystdex::invoke_for_value(0, f))
    22062213 CatchExpr(std::system_error& e, seterr(r, e.code().value()))
    @@ -2232,7 +2239,7 @@
    22322239 }
    22332240
    22342241 //! \since build 764
    2235-//@{
    2242+//!@{
    22362243 template<class _tHolder, typename _fCallable, class _type, typename... _tParams>
    22372244 inline auto
    22382245 locked_invoke(_tHolder& holder, _fCallable&& f, _type& x, _tParams&&... args)
    @@ -2271,7 +2278,7 @@
    22712278 std::forward<_tParams>(args)...);
    22722279 });
    22732280 }
    2274-//@}
    2281+//!@}
    22752282
    22762283 //! \since build 826
    22772284 template<typename _fCheck, typename _fCallable, typename... _tParams>
    @@ -2325,7 +2332,7 @@
    23252332
    23262333 return int(file_struct);
    23272334 });
    2328- }, [] YB_LAMBDA_ANNOTATE((::_reent* r, void* fh) , ynothrowv, nonnull(2)){
    2335+ }, [] YB_LAMBDA_ANNOTATE((::_reent* r, void* fh), ynothrowv, nonnull(2)){
    23292336 // NOTE: The parameter %fd is actually cast from the file structure
    23302337 // pointer stored by %devoptab_t::open_r. This function is called
    23312338 // when the reference count in the handle decreased to zero. Since this
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/YFramework.vcxproj
    --- a/YFramework/YFramework.vcxproj Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/YFramework.vcxproj Tue Feb 27 00:28:20 2024 +0800
    @@ -101,6 +101,7 @@
    101101 <ClInclude Include="include\NPL\SXML.h" />
    102102 <ClInclude Include="include\NPL\YModules.h" />
    103103 <ClInclude Include="include\YBaseMacro.h" />
    104+ <ClInclude Include="include\YCLib\Basic.h" />
    104105 <ClInclude Include="include\YCLib\Container.h" />
    105106 <ClInclude Include="include\YCLib\Debug.h" />
    106107 <ClInclude Include="include\YCLib\FileIO.h" />
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/YFramework.vcxproj.filters
    --- a/YFramework/YFramework.vcxproj.filters Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/YFramework.vcxproj.filters Tue Feb 27 00:28:20 2024 +0800
    @@ -745,6 +745,9 @@
    745745 <ClInclude Include="include\NPL\NPLA1Root.h">
    746746 <Filter>include\NPL</Filter>
    747747 </ClInclude>
    748+ <ClInclude Include="include\YCLib\Basic.h">
    749+ <Filter>include\YCLib</Filter>
    750+ </ClInclude>
    748751 </ItemGroup>
    749752 <ItemGroup>
    750753 <ClCompile Include="source\YSLib\Adaptor\YNew.cpp">
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/CHRLib/CharacterProcessing.h
    --- a/YFramework/include/CHRLib/CharacterProcessing.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/CHRLib/CharacterProcessing.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2015, 2018-2019, 2021-2022 FrankHB.
    2+ © 2009-2015, 2018-2019, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file CharacterProcessing.h
    1212 \ingroup CHRLib
    1313 \brief 字符编码处理。
    14-\version r2420
    14+\version r2501
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 565
    1717 \par 创建时间:
    1818 2009-11-17 17:52:35 +0800
    1919 \par 修改时间:
    20- 2022-11-21 05:58 +0800
    20+ 2023-12-20 20:33 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -71,11 +71,11 @@
    7171
    7272
    7373 //! \return 转换的字节数。
    74-//@{
    74+//!@{
    7575 //! \since build 641
    76-//@{
    76+//!@{
    7777 //! \brief 按指定编码和转换状态转换字符串中的字符为 UCS-2 字符。
    78-//@{
    78+//!@{
    7979 YF_API ConversionResult
    8080 MBCToUC(char16_t&, const char*&, Encoding, ConversionState&& = {});
    8181 YF_API ConversionResult
    @@ -83,24 +83,24 @@
    8383 inline PDefH(ConversionResult, MBCToUC, char16_t& uc, const char*& c,
    8484 Encoding enc, ConversionState& st)
    8585 ImplRet(MBCToUC(uc, c, enc, std::move(st)))
    86-//@}
    86+//!@}
    8787 /*!
    8888 \brief 按指定编码和转换状态转换字符流中的字符为 UCS-2 字符。
    8989 \pre 断言:指针参数非空。
    9090 */
    91-//@{
    91+//!@{
    9292 YF_API YB_NONNULL(2) ConversionResult
    9393 MBCToUC(char16_t&, std::FILE*, Encoding, ConversionState&& = {});
    9494 inline PDefH(ConversionResult, MBCToUC, char16_t& uc, std::FILE* fp, Encoding enc,
    9595 ConversionState& st)
    9696 ImplRet(MBCToUC(uc, fp, enc, std::move(st)))
    97-//@}
    98-//@}
    97+//!@}
    98+//!@}
    9999 /*!
    100100 \brief 按指定编码和转换状态返回转换字符为 UCS-2 字符的字节数。
    101101 \since build 291
    102102 */
    103-//@{
    103+//!@{
    104104 YF_API ConversionResult
    105105 MBCToUC(const char*&, Encoding, ConversionState&& = {});
    106106 //! \since build 614
    @@ -114,14 +114,14 @@
    114114 Encoding enc, ConversionState& st)
    115115 ImplRet(MBCToUC(c, e, enc, std::move(st)))
    116116 //! \pre 断言:指针参数非空。
    117-//@{
    117+//!@{
    118118 YF_API YB_NONNULL(1) ConversionResult
    119119 MBCToUC(std::FILE*, Encoding, ConversionState&& = {});
    120120 YB_NONNULL(1) inline PDefH(ConversionResult, MBCToUC, std::FILE* fp,
    121121 Encoding enc, ConversionState& st)
    122122 ImplRet(MBCToUC(fp, enc, std::move(st)))
    123-//@}
    124-//@}
    123+//!@}
    124+//!@}
    125125
    126126 /*!
    127127 \brief 按指定编码转换 UCS-2 字符为字符串表示的多字节字符。
    @@ -131,13 +131,13 @@
    131131 */
    132132 YF_API YB_NONNULL(1) size_t
    133133 UCToMBC(char*, const char16_t&, Encoding);
    134-//@}
    134+//!@}
    135135
    136136
    137137 //! \note 编码字节序同实现的 char16_t 存储字节序。
    138-//@{
    138+//!@{
    139139 //! \since build 645
    140-//@{
    140+//!@{
    141141 template<typename _func, typename _tDst, typename _tSrc>
    142142 YB_NONNULL(2, 3) size_t
    143143 TranscodeWith(_func f, _tDst* d, const _tSrc* s)
    @@ -165,10 +165,10 @@
    165165 f(d, s, e);
    166166 return size_t(d - p);
    167167 }
    168-//@}
    168+//!@}
    169169
    170170 //! \since build 644
    171-//@{
    171+//!@{
    172172 template<typename _func, typename _tDst, typename _tSrc>
    173173 YB_NONNULL(2, 3) size_t
    174174 DecodeWith(_func f, _tDst* d, const _tSrc* s)
    @@ -209,18 +209,18 @@
    209209 f(dst, src, end);
    210210 }, d, s, e);
    211211 }
    212-//@}
    212+//!@}
    213213
    214214 /*!
    215215 \pre 断言:指针参数非空 。
    216-\pre 第一参数指向的缓冲区能容纳转换后的 NTCTS (包括结尾的空字符)。
    216+\pre 第一参数指向的缓冲区能容纳转换后的 NTCTS(包括结尾的空字符)。
    217217 \pre 指针参数指向的缓冲区不重叠。
    218218 \return 转换的串长。
    219219 \since build 645
    220220 */
    221-//@{
    221+//!@{
    222222 //! \brief 按指定编码转换 MBCS 字符串为 UCS-2 字符串。
    223-//@{
    223+//!@{
    224224 template<typename _func>
    225225 YB_NONNULL(2, 3) size_t
    226226 MBCSToUCS2(_func f, char16_t* d, const char* s)
    @@ -246,10 +246,10 @@
    246246 MBCSToUCS2(char16_t*, const char*, const char* e);
    247247 YF_API YB_NONNULL(1, 2, 3) size_t
    248248 MBCSToUCS2(char16_t*, const char*, const char* e, Encoding);
    249-//@}
    249+//!@}
    250250
    251251 //! \brief 按指定编码转换 MBCS 字符串为 UCS-4 字符串。
    252-//@{
    252+//!@{
    253253 template<typename _func>
    254254 YB_NONNULL(2, 3) size_t
    255255 MBCSToUCS4(_func f, char32_t* d, const char* s)
    @@ -291,12 +291,12 @@
    291291 MBCSToUCS4(char32_t*, const char*, const char*);
    292292 YF_API YB_NONNULL(1, 2, 3) size_t
    293293 MBCSToUCS4(char32_t*, const char*, const char*, Encoding);
    294-//@}
    294+//!@}
    295295
    296296 //! \brief 按指定编码转换 UCS-2 字符串为 MBCS 字符串。
    297-//@{
    297+//!@{
    298298 //! \since build 644
    299-//@{
    299+//!@{
    300300 template<typename _func>
    301301 YB_NONNULL(2, 3) size_t
    302302 UCS2ToMBCS(_func f, char* d, const char16_t* s)
    @@ -314,7 +314,7 @@
    314314 dst += f(dst, *src++);
    315315 }, d, s, e);
    316316 }
    317-//@}
    317+//!@}
    318318 YF_API YB_FLATTEN YB_NONNULL(1, 2) size_t
    319319 UCS2ToMBCS(char*, const char16_t*);
    320320 YF_API YB_NONNULL(1, 2) size_t
    @@ -323,23 +323,23 @@
    323323 UCS2ToMBCS(char*, const char16_t*, const char16_t*);
    324324 YF_API YB_NONNULL(1, 2, 3) size_t
    325325 UCS2ToMBCS(char*, const char16_t*, const char16_t*, Encoding);
    326-//@}
    326+//!@}
    327327
    328328 /*!
    329329 \brief 转换 UCS-2 字符串为 UCS-4 字符串。
    330330 \since build 641
    331331 */
    332-//@{
    332+//!@{
    333333 YF_API YB_NONNULL(1, 2) size_t
    334334 UCS2ToUCS4(char32_t*, const char16_t*);
    335335 YF_API YB_NONNULL(1, 2, 3) size_t
    336336 UCS2ToUCS4(char32_t*, const char16_t*, const char16_t*);
    337-//@}
    337+//!@}
    338338
    339339 //! \brief 按指定编码转换 UCS-4 字符串为 MBCS 字符串。
    340-//@{
    340+//!@{
    341341 //! \since build 644
    342-//@{
    342+//!@{
    343343 template<typename _func>
    344344 YB_NONNULL(2, 3) size_t
    345345 UCS4ToMBCS(_func f, char* d, const char32_t* s)
    @@ -357,7 +357,7 @@
    357357 dst += f(dst, char16_t(*src++));
    358358 }, d, s, e);
    359359 }
    360-//@}
    360+//!@}
    361361 YF_API YB_FLATTEN YB_NONNULL(1, 2) size_t
    362362 UCS4ToMBCS(char*, const char32_t*);
    363363 YF_API YB_NONNULL(1, 2) size_t
    @@ -366,23 +366,23 @@
    366366 UCS4ToMBCS(char*, const char32_t*, const char32_t*);
    367367 YF_API YB_NONNULL(1, 2, 3) size_t
    368368 UCS4ToMBCS(char*, const char32_t*, const char32_t*, Encoding);
    369-//@}
    369+//!@}
    370370
    371371 /*!
    372372 \brief 转换 UCS-4 字符串为 UCS-2 字符串。
    373373 \since build 641
    374374 */
    375-//@{
    375+//!@{
    376376 YF_API YB_NONNULL(1, 2) size_t
    377377 UCS4ToUCS2(char16_t*, const char32_t*);
    378378 YF_API YB_NONNULL(1, 2, 3) size_t
    379379 UCS4ToUCS2(char16_t*, const char32_t*, const char32_t*);
    380-//@}
    381-//@}
    380+//!@}
    381+//!@}
    382382
    383383
    384384 //! \since build 645
    385-//@{
    385+//!@{
    386386 template<Encoding, Encoding>
    387387 struct DispatchTranscoding;
    388388
    @@ -601,7 +601,7 @@
    601601 return str;
    602602 }
    603603 };
    604-//@}
    604+//!@}
    605605
    606606
    607607 /*!
    @@ -609,13 +609,13 @@
    609609 \pre 断言:指针参数非空。
    610610 \since build 645
    611611 */
    612-//@{
    612+//!@{
    613613 #define CHRLib_Impl_Transcode(_vFrom, _vTo, ...) \
    614- return Transcoding<CharSet::_vFrom, CharSet::_vTo> \
    615- ::MakeTranscoded<_tDst>(__VA_ARGS__);
    614+ return Transcoding<CharSet::_vFrom, CharSet::_vTo>::MakeTranscoded<_tDst>( \
    615+ __VA_ARGS__);
    616616 #define CHRLib_Impl_TranscodeView(_vFrom, _vTo, ...) \
    617- return Transcoding<CharSet::_vFrom, CharSet::_vTo> \
    618- ::MakeViewTranscoded<_tDst>(__VA_ARGS__);
    617+ return Transcoding<CharSet::_vFrom, CharSet::_vTo>::MakeViewTranscoded< \
    618+ _tDst>(__VA_ARGS__);
    619619 #define CHRLib_Impl_MakeTrans(_n, _tSrcChar, _tDstChar, _vFrom, _vTo, _vDeEnc) \
    620620 template<class _tDst = std::basic_string<_tDstChar>, typename... _tParams> \
    621621 YB_ATTR_nodiscard YB_NONNULL(1) YB_PURE _tDst \
    @@ -646,92 +646,82 @@
    646646 yforward(args)...); \
    647647 }
    648648 //! \brief 转换指定编码的多字节字符串为指定类型的 UCS-2 字符串。
    649-//@{
    649+//!@{
    650650 CHRLib_Impl_MakeTrans(UCS2LE, char, char16_t, Null, ISO_10646_UCS_2, CS_Default)
    651-//@}
    651+//!@}
    652652 /*!
    653653 \warning 假定本机字节序为小端序。
    654654 \todo 支持字节序转换。
    655655 */
    656-//@{
    656+//!@{
    657657 /*!
    658658 \brief 构造指定类型的 UCS-2 字符串。
    659659 \since build 641
    660660 */
    661661 template<class _tDst = std::basic_string<char16_t>>
    662-YB_ATTR_nodiscard YB_PURE inline _tDst
    662+YB_ATTR_nodiscard YB_PURE yconstfn _tDst
    663663 MakeUCS2LE(u16string_view sv, Encoding = CharSet::ISO_10646_UCS_2)
    664664 {
    665- const auto s(sv.data());
    666-
    667- yconstraint(s);
    668665 // TODO: Support correct conversion for encoding other than UCS-2LE.
    669- return {s, sv.length()};
    666+ return yconstraint(sv.data()), _tDst(sv.data(), sv.length());
    670667 }
    671668 /*!
    672669 \brief 使用指定的分配器构造指定类型的 UCS-2 字符串。
    673670 \since build 861
    674671 */
    675672 template<class _tDst = std::basic_string<char16_t>>
    676-YB_ATTR_nodiscard YB_PURE inline _tDst
    673+YB_ATTR_nodiscard YB_PURE yconstfn _tDst
    677674 MakeUCS2LE(std::allocator_arg_t, const typename _tDst::allocator_type& a,
    678675 u16string_view sv, Encoding = CharSet::ISO_10646_UCS_2)
    679676 {
    680- const auto s(sv.data());
    681-
    682- yconstraint(s);
    683677 // TODO: Support correct conversion for encoding other than UCS-2LE.
    684- return ystdex::make_obj_using_allocator<_tDst>(a, s, sv.length());
    678+ return yconstraint(sv.data()),
    679+ ystdex::make_obj_using_allocator<_tDst>(a, sv.data(), sv.length());
    685680 }
    686681 //! \brief 转换 UCS-4 字符串为指定类型的 UCS-2 字符串。
    687-//@{
    682+//!@{
    688683 CHRLib_Impl_MakeTrans(UCS2LE, char32_t, char16_t, ISO_10646_UCS_4,
    689684 ISO_10646_UCS_2, CharSet::ISO_10646_UCS_4)
    690-//@}
    685+//!@}
    691686
    692687 //! \brief 转换指定编码的多字节字符串为指定类型的 UCS-4 字符串。
    693-//@{
    688+//!@{
    694689 CHRLib_Impl_MakeTrans(UCS4LE, char, char32_t, Null, ISO_10646_UCS_4, CS_Default)
    695-//@}
    690+//!@}
    696691 //! \brief 转换 UCS-2 字符串为指定类型的 UCS-4 字符串。
    697-//@{
    692+//!@{
    698693 CHRLib_Impl_MakeTrans(UCS4LE, char16_t, char32_t, ISO_10646_UCS_2,
    699694 ISO_10646_UCS_4, CharSet::ISO_10646_UCS_2)
    700-//@}
    695+//!@}
    701696 /*!
    702697 \brief 构造指定类型的 UCS-4 字符串。
    703698 \since build 641
    704699 */
    705700 template<class _tDst = std::basic_string<char32_t>>
    706-YB_ATTR_nodiscard YB_PURE inline _tDst
    701+YB_ATTR_nodiscard YB_PURE yconstfn _tDst
    707702 MakeUCS4LE(u32string_view sv, Encoding = CharSet::ISO_10646_UCS_4)
    708703 {
    709- const auto s(sv.data());
    710-
    711- yconstraint(s);
    712704 // TODO: Support correct conversion for encoding other than UCS-4LE.
    713- return {s, sv.length()};
    705+ return yconstraint(sv.data()), _tDst(sv.data(), sv.length());
    714706 }
    715707 /*!
    716708 \brief 使用指定的分配器构造指定类型的 UCS-4 字符串。
    717709 \since build 861
    718710 */
    719711 template<class _tAlloc, class _tDst = std::basic_string<char32_t>>
    720-YB_ATTR_nodiscard YB_PURE inline _tDst
    712+YB_ATTR_nodiscard YB_PURE yconstfn _tDst
    721713 MakeUCS4LE(std::allocator_arg_t, const typename _tDst::allocator_type& a,
    722714 u32string_view sv, Encoding = CharSet::ISO_10646_UCS_4)
    723715 {
    724- const auto s(sv.data());
    725-
    726- yconstraint(s);
    727716 // TODO: Support correct conversion for encoding other than UCS-4LE.
    728- return ystdex::make_obj_using_allocator<_tDst>(a, s, sv.length());
    717+ return yconstraint(sv.data()),
    718+ ystdex::make_obj_using_allocator<_tDst>(a, sv.data(), sv.length());
    729719 }
    730-//@}
    720+//!@}
    731721
    732-//@{
    722+//!@{
    733723 //! \brief 转换 UTF-8 字符串为指定编码的多字节字符串。
    734-//@{
    724+//!@{
    735725 //! \since build 544
    736726 template<class _tDst = std::string>
    737727 YB_ATTR_nodiscard YB_NONNULL(1) YB_PURE inline _tDst
    @@ -767,20 +757,20 @@
    767757 : MakeMBCS<_tDst>(std::allocator_arg, a,
    768758 MakeUCS2LE(std::allocator_arg, a, sv, CS_Default), enc);
    769759 }
    770-//@}
    760+//!@}
    771761 //! \brief 转换 UCS-2LE 字符串为指定编码的多字节字符串。
    772-//@{
    762+//!@{
    773763 CHRLib_Impl_MakeTrans(MBCS, char16_t, char, ISO_10646_UCS_2, Null, CS_Default)
    774-//@}
    764+//!@}
    775765 //! \brief 转换 UCS-4LE 字符串为指定编码的多字节字符串。
    776-//@{
    766+//!@{
    777767 CHRLib_Impl_MakeTrans(MBCS, char32_t, char, ISO_10646_UCS_4, Null, CS_Default)
    778-//@}
    779-//@}
    768+//!@}
    769+//!@}
    780770 #undef CHRLib_Impl_MakeTrans
    781771 #undef CHRLib_Impl_Transcode
    782772 #undef CHRLib_Impl_TranscodeView
    783-//@}
    773+//!@}
    784774
    785775 } // namespace CHRLib;
    786776
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/CHRLib/StaticMapping.hpp
    --- a/YFramework/include/CHRLib/StaticMapping.hpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/CHRLib/StaticMapping.hpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2017, 2019, 2021-2022 FrankHB.
    2+ © 2009-2017, 2019, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file StaticMapping.hpp
    1212 \ingroup CHRLib
    1313 \brief 静态编码映射。
    14-\version r2657
    14+\version r2701
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 587
    1717 \par 创建时间:
    1818 2009-11-17 17:53:21 +0800
    1919 \par 修改时间:
    20- 2022-11-28 19:39 +0800
    20+ 2023-12-20 20:33 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -39,7 +39,7 @@
    3939 {
    4040
    4141 //! \since build 644
    42-//@{
    42+//!@{
    4343 /*!
    4444 \brief 检查解码迭代器。
    4545 \pre is_undereferenceable 不抛出异常。
    @@ -50,8 +50,8 @@
    5050 {
    5151 using value_t = ystdex::remove_cvref_t<decltype(*i)>;
    5252 static_assert(ystdex::or_<std::is_convertible<value_t, byte>,
    53- ystdex::bool_<std::is_integral<value_t>::value
    54- && sizeof(value_t) == 1>>(), "Invalid mapping source type found.");
    53+ ystdex::bool_<std::is_integral<value_t>() && sizeof(value_t) == 1>>(),
    54+ "Invalid mapping source type found.");
    5555 using ystdex::is_undereferenceable;
    5656
    5757 return !is_undereferenceable(i);
    @@ -61,7 +61,7 @@
    6161 \brief 以输入迭代器指向内容填充有效输入迭代器指定的字节。
    6262 \note 使用 ADL CheckIterator 检查迭代器。
    6363 */
    64-//@{
    64+//!@{
    6565 template<typename _tIn>
    6666 inline bool
    6767 FillByte(_tIn& i, byte& b) ynoexcept(noexcept(byte(*i)) && noexcept(++i))
    @@ -82,8 +82,8 @@
    8282 {
    8383 if(CheckIterator(i))
    8484 {
    85- static_assert(!std::is_volatile<ystdex::remove_reference_t<
    86- _tState>>::value, "Volatile state is not supported.");
    85+ static_assert(!std::is_volatile<ystdex::remove_reference_t<_tState>
    86+ >::value, "Volatile state is not supported.");
    8787 const auto r = byte(*i);
    8888
    8989 yunseq(++i, GetSequenceOf(st)[GetIndexOf(st)++] = r);
    @@ -105,12 +105,12 @@
    105105 {
    106106 return pr.first.get() != pr.second ? FillByte(pr.first.get(), st) : false;
    107107 }
    108-//@}
    109-//@}
    108+//!@}
    109+//!@}
    110110
    111111
    112112 //! \since build 594
    113-//@{
    113+//!@{
    114114 //! \brief 判断八元组是否组成 UTF-16 代理对起始代码的高 8 位。
    115115 yconstfn PDefH(bool, IsSurrogateHead, octet x) ynothrow
    116116 ImplRet(x >= 0xD8 && x < 0xE0)
    @@ -128,7 +128,7 @@
    128128 struct UCSMapperBase
    129129 {
    130130 //! \since build 641
    131- //@{
    131+ //!@{
    132132 static void
    133133 Assign(ystdex::pseudo_output, char32_t) ynothrow
    134134 {}
    @@ -140,7 +140,7 @@
    140140
    141141 uc = _tObj(c);
    142142 }
    143- //@}
    143+ //!@}
    144144
    145145 /*!
    146146 \brief 编码字符。
    @@ -180,14 +180,14 @@
    180180 解码操作允许接受 ystdex::pseudo_output 忽略输出。
    181181 使用模板参数决定状态类型中,状态索引等于已解码的输入字节数;否则不予保证。
    182182 */
    183-//@{
    183+//!@{
    184184 template<Encoding>
    185185 class GUCSMapper
    186186 {};
    187187
    188188 /*!
    189189 \warning 使用 UCS-2 时, 4 字节代码点可能溢出。
    190-\see 参考规范: RFC 3629 ,见 http://tools.ietf.org/html/rfc3629 。
    190+\see 参考规范:RFC 3629 ,见 http://tools.ietf.org/html/rfc3629 。
    191191 */
    192192 template<>
    193193 struct GUCSMapper<CharSet::UTF_8> : UCSMapperBase
    @@ -198,14 +198,14 @@
    198198
    199199 private:
    200200 //! \since build 932
    201- //@{
    201+ //!@{
    202202 // XXX: See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90966.
    203203 #if YB_IMPL_GNUCPP && YB_IMPL_GNUCPP >= 90000
    204204 using DecodeTableState = unsigned char;
    205205 #else
    206206 using DecodeTableState = std::uint_fast8_t;
    207207 #endif
    208- //@}
    208+ //!@}
    209209
    210210 template<typename _tObj, typename _tSeq>
    211211 static void
    @@ -237,7 +237,7 @@
    237237 public:
    238238 /*!
    239239 \brief 检查 UTF-8 文本序列中非法字节。
    240- \note 包括: C0 、 C1 、 F5 至 FF 。
    240+ \note 包括:C0 、 C1 、 F5 至 FF 。
    241241 */
    242242 YB_ATTR_nodiscard YB_STATELESS static yconstfn bool
    243243 IsInvalid(octet x) ynothrow
    @@ -246,14 +246,13 @@
    246246 }
    247247
    248248 /*!
    249- \brief 解码: UTF-8 。
    249+ \brief 解码:UTF-8 。
    250250 \since build 599
    251251 */
    252252 template<typename _tObj, typename _tIn, typename _tState>
    253253 YB_ATTR_nodiscard static ConversionResult
    254- Decode(_tObj&& uc, _tIn&& i, _tState&& st)
    255- ynoexcept(noexcept(GetSequenceOf(st)) && noexcept(GetIndexOf(st))
    256- && noexcept(!FillByte(i, st)))
    254+ Decode(_tObj&& uc, _tIn&& i, _tState&& st) ynoexcept(noexcept(GetSequenceOf(
    255+ st)) && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
    257256 {
    258257 const auto seq(GetSequenceOf(st));
    259258
    @@ -309,11 +308,11 @@
    309308 return ConversionResult::OK;
    310309 }
    311310 /*!
    312- \brief 快速解码: UTF-8 。
    311+ \brief 快速解码:UTF-8 。
    313312 \see https://github.com/miloyip/rapidjson/blob/master/include/rapidjson/encodings.h 。
    314313 \since build 599
    315314 */
    316- //@{
    315+ //!@{
    317316 template<typename _tObj, typename _tIn>
    318317 YB_ATTR_nodiscard static ConversionResult
    319318 Decode(_tObj&& uc, _tIn&& i, ConversionState& st)
    @@ -406,7 +405,7 @@
    406405 {
    407406 return Decode(uc, yforward(i), st);
    408407 }
    409- //@}
    408+ //!@}
    410409
    411410 //! \since build 641
    412411 template<typename _tOut>
    @@ -461,14 +460,13 @@
    461460 using UCSMapperBase::Assign;
    462461
    463462 /*!
    464- \brief 解码: UTF-16BE 。
    463+ \brief 解码:UTF-16BE 。
    465464 \since build 599
    466465 */
    467466 template<typename _tObj, typename _tIn, typename _tState>
    468467 YB_ATTR_nodiscard static ConversionResult
    469- Decode(_tObj&& uc, _tIn&& i, _tState&& st)
    470- ynoexcept(noexcept(GetSequenceOf(st))
    471- && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
    468+ Decode(_tObj&& uc, _tIn&& i, _tState&& st) ynoexcept(noexcept(GetSequenceOf(
    469+ st)) && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
    472470 {
    473471 const auto seq(GetSequenceOf(st));
    474472
    @@ -519,14 +517,13 @@
    519517 using UCSMapperBase::Assign;
    520518
    521519 /*!
    522- \brief 解码: UTF-16LE 。
    520+ \brief 解码:UTF-16LE 。
    523521 \since build 599
    524522 */
    525523 template<typename _tObj, typename _tIn, typename _tState>
    526524 YB_ATTR_nodiscard static ConversionResult
    527- Decode(_tObj&& uc, _tIn&& i, _tState&& st)
    528- ynoexcept(noexcept(GetSequenceOf(st))
    529- && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
    525+ Decode(_tObj&& uc, _tIn&& i, _tState&& st) ynoexcept(noexcept(GetSequenceOf(
    526+ st)) && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
    530527 {
    531528 const auto seq(GetSequenceOf(st));
    532529
    @@ -570,21 +567,20 @@
    570567 }
    571568 };
    572569
    573-//! \see 参考规范: UAX #19 ,见 http://www.unicode.org/unicode/reports/tr19/ 。
    570+//! \see 参考规范:UAX #19 ,见 http://www.unicode.org/unicode/reports/tr19/ 。
    574571 template<>
    575572 struct GUCSMapper<CharSet::UTF_32BE> : UCSMapperBase
    576573 {
    577574 using UCSMapperBase::Assign;
    578575
    579576 /*!
    580- \brief 解码: UTF-32BE 。
    577+ \brief 解码:UTF-32BE 。
    581578 \since build 599
    582579 */
    583580 template<typename _tObj, typename _tIn, typename _tState>
    584581 YB_ATTR_nodiscard static ConversionResult
    585- Decode(_tObj&& uc, _tIn&& i, _tState&& st)
    586- ynoexcept(noexcept(GetSequenceOf(st))
    587- && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
    582+ Decode(_tObj&& uc, _tIn&& i, _tState&& st) ynoexcept(noexcept(GetSequenceOf(
    583+ st)) && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
    588584 {
    589585 const auto seq(GetSequenceOf(st));
    590586
    @@ -615,21 +611,20 @@
    615611 }
    616612 };
    617613
    618-//! \see 参考规范: UAX #19 ,见 http://www.unicode.org/unicode/reports/tr19/ 。
    614+//! \see 参考规范:UAX #19 ,见 http://www.unicode.org/unicode/reports/tr19/ 。
    619615 template<>
    620616 struct GUCSMapper<CharSet::UTF_32LE> : UCSMapperBase
    621617 {
    622618 using UCSMapperBase::Assign;
    623619
    624620 /*!
    625- \brief 解码: UTF-32LE 。
    621+ \brief 解码:UTF-32LE 。
    626622 \since build 599
    627623 */
    628624 template<typename _tObj, typename _tIn, typename _tState>
    629625 YB_ATTR_nodiscard static ConversionResult
    630- Decode(_tObj&& uc, _tIn&& i, _tState&& st)
    631- ynoexcept(noexcept(GetSequenceOf(st))
    632- && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
    626+ Decode(_tObj&& uc, _tIn&& i, _tState&& st) ynoexcept(noexcept(GetSequenceOf(
    627+ st)) && noexcept(GetIndexOf(st)) && noexcept(!FillByte(i, st)))
    633628 {
    634629 const auto seq(GetSequenceOf(st));
    635630
    @@ -659,8 +654,8 @@
    659654 return ConversionResult::OK;
    660655 }
    661656 };
    662-//@}
    663-//@}
    657+//!@}
    658+//!@}
    664659
    665660 } // namespace CHRLib;
    666661
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/Helper/Environment.h
    --- a/YFramework/include/Helper/Environment.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/Helper/Environment.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2013-2016, 2020, 2022 FrankHB.
    2+ © 2013-2016, 2020, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Environment.h
    1212 \ingroup Helper
    1313 \brief 环境。
    14-\version r1160
    14+\version r1169
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 521
    1717 \par 创建时间:
    1818 2013-02-08 01:28:03 +0800
    1919 \par 修改时间:
    20- 2022-09-13 06:37 +0800
    20+ 2023-12-20 20:34 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -55,7 +55,7 @@
    5555
    5656 #if YCL_Android
    5757 //! \since build 502
    58-//@{
    58+//!@{
    5959 namespace Devices
    6060 {
    6161
    @@ -69,7 +69,7 @@
    6969 class NativeHost;
    7070
    7171 } // namespace Android;
    72-//@}
    72+//!@}
    7373 #endif
    7474
    7575
    @@ -91,7 +91,7 @@
    9191 */
    9292 ValueNode Root{};
    9393 //! \since build 954
    94- //@{
    94+ //!@{
    9595 ostringstream DefaultOutputStream;
    9696 //! \since build 955
    9797 NPL::A1::GlobalState Global;
    @@ -103,7 +103,7 @@
    103103 # if YF_Helper_Environment_NPL_UseBacktrace
    104104 NPL::ContextNode::ReducerSequence backtrace{Global.Allocator};
    105105 # endif
    106- //@}
    106+ //!@}
    107107
    108108 public:
    109109 /*!
    @@ -116,17 +116,17 @@
    116116 ~Environment();
    117117
    118118 //! \since build 688
    119- //@{
    119+ //!@{
    120120 /*!
    121121 \brief 取值类型根节点。
    122122 \pre 断言:已初始化。
    123123 */
    124124 ValueNode&
    125125 GetRootRef() ynothrowv;
    126- //@}
    126+ //!@}
    127127
    128128 //! \since build 954
    129- //@{
    129+ //!@{
    130130 template<typename _func>
    131131 void
    132132 ExecuteNPLA1(_func f)
    @@ -170,7 +170,7 @@
    170170 return NPL::A1::ReduceOnce(Term, ctx);
    171171 }));
    172172 }
    173- //@}
    173+ //!@}
    174174 };
    175175
    176176 } // namespace YSLib;
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/Helper/Initialization.h
    --- a/YFramework/include/Helper/Initialization.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/Helper/Initialization.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2016, 2019-2020, 2022-2023 FrankHB.
    2+ © 2009-2016, 2019-2020, 2022-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Initialization.h
    1212 \ingroup Helper
    1313 \brief 框架初始化。
    14-\version r915
    14+\version r955
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since 早于 build 132
    1717 \par 创建时间:
    1818 2009-10-21 23:15:08 +0800
    1919 \par 修改时间:
    20- 2023-03-30 02:59 +0800
    20+ 2024-02-25 02:05 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -30,7 +30,7 @@
    3030
    3131 #include "YModules.h"
    3232 #include YFM_YSLib_Core_ValueNode // for string, ValueNode;
    33-#include YFM_YSLib_Service_FileSystem // for IO::Path;
    33+#include YFM_YSLib_Service_FileSystem // for Deployment::RootPathBlock;
    3434 #include YFM_YSLib_Core_YApplication // for Application;
    3535 #include YFM_YSLib_Adaptor_Font // for Drawing::FontCache;
    3636 #include YFM_YSLib_Service_ContentType // for MIMEBiMapping;
    @@ -57,51 +57,14 @@
    5757 TraceForOutermost(const std::exception&, RecordLevel) ynothrow;
    5858
    5959
    60-//! \since build 899
    61-//!@{
    62-/*!
    63-\brief 判断指定程序映像的路径字符串指示的位置是否符合局部 FHS 目录布局。
    64-\see https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html 。
    65-
    66-以 POSIX 环境变量语法,预期的局部用户目录布局为:
    67-$PREFIX/
    68-$PREFIX/$BIN/
    69-$PREFIX/lib/
    70-$PREFIX/share/
    71-其中,$PREFIX 为路径前缀,$BIN 是任意非空的目录名。
    72-当参数指定 $PREFIX/$BIN/ 目录,且以上路径以目录存在时,检查通过。
    73-假定检查目录时,布局不改变。
    74-实现可分别检查各项路径,而不要求避免外部并发访问的竞争。
    75-*/
    76-YB_ATTR_nodiscard YF_API YB_PURE bool
    77-CheckLocalFHSLayout(const string&);
    78-
    7960 /*!
    80-\brief 取根路径字符串对应的局部 FHS 根路径。
    81-\sa FetchRootPathString
    82-\sa GetLocalFHSRootPathOf
    83-*/
    84-YB_ATTR_nodiscard YF_API YB_PURE const IO::Path&
    85-FetchLocalFHSRootPath();
    86-
    87-/*!
    88-\brief 取框架根路径字符串。
    89-\return 以平台路径分隔符结尾的目录路径字符串。
    61+\brief 取根路径字符串对应的根路径块。
    62+\note 在首次调用时会初始化并缓存到静态存储。
    63+\sa Deployment::RootPathBlock
    64+\since build 982
    9065 */
    91-YB_ATTR_nodiscard YF_API YB_PURE const string&
    92-FetchRootPathString();
    93-
    94-/*!
    95-\brief 取指定程序映像的路径字符串对应的局部 fHS 根路径。
    96-\sa CheckLocalFHSLayout
    97-\sa FetchRootPathString
    98-
    99-若框架根路径的 CheckLocalFHSLayout 检查通过,局部 fHS 根路径为对应的 $PREFIX ;
    100-否则,局部 fHS 根路径路径为空。
    101-*/
    102-YB_ATTR_nodiscard YF_API YB_PURE IO::Path
    103-GetLocalFHSRootPathOf(const string&);
    104-//!@}
    66+YB_ATTR_nodiscard YB_PURE const Deployment::RootPathBlock&
    67+FetchRootPathBlock();
    10568
    10669
    10770 //! \since build 971
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/Helper/ShellHelper.h
    --- a/YFramework/include/Helper/ShellHelper.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/Helper/ShellHelper.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2010-2016, 2019, 2021-2022 FrankHB.
    2+ © 2010-2016, 2019, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file ShellHelper.h
    1212 \ingroup Helper
    1313 \brief Shell 助手模块。
    14-\version r2065
    14+\version r2085
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 278
    1717 \par 创建时间:
    1818 2010-03-14 14:07:22 +0800
    1919 \par 修改时间:
    20- 2022-01-21 20:38 +0800
    20+ 2023-12-20 20:10 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -30,7 +30,6 @@
    3030
    3131 #include <Helper/YModules.h>
    3232 #include <YCLib/YModules.h>
    33-#include YFM_YCLib_Debug
    3433 #include YFM_YSLib_UI_YDesktop // for UI::Desktop;
    3534 #include YFM_YSLib_Core_YApplication // for Shell, FetchAppInstance;
    3635 #include YFM_YSLib_Service_YTimer // for Timers::HighResolutionClock;
    @@ -90,7 +89,7 @@
    9089
    9190 virtual DefDeDtor(GShellSession)
    9291
    93- DefGetter(const ynothrow, _tShell&, Shell, conn)
    92+ YB_ATTR_nodiscard DefGetter(const ynothrow, _tShell&, Shell, conn)
    9493 };
    9594
    9695
    @@ -121,7 +120,7 @@
    121120
    122121
    123122 //! \ingroup helper_functions
    124-//@{
    123+//!@{
    125124 /*!
    126125 \brief 取指定 Shell 句柄对应的 Shell 引用 。
    127126 \since build 205
    @@ -138,25 +137,25 @@
    138137 \brief 判断句柄指定的 Shell 是否为当前线程空间中运行的 Shell 。
    139138 \since 早于 build 132
    140139 */
    141-inline PDefH(bool, IsNowShell, const shared_ptr<Shell>& hShl)
    142- ImplRet(FetchAppInstance().GetShellHandle() == hShl)
    140+inline PDefH(bool, IsNowShell, const shared_ptr<Shell>& h)
    141+ ImplRet(FetchAppInstance().GetShellHandle() == h)
    143142
    144143 /*!
    145144 \brief 向句柄指定的 Shell 对象转移线程控制权。
    146-\since build 594
    145+\since build 955
    147146 */
    148-inline PDefH(void, NowShellTo, const shared_ptr<Shell>& hShl)
    149- ImplExpr(Activate(hShl))
    147+inline PDefH(void, NowShellTo, shared_ptr<Shell> h)
    148+ ImplExpr(Activate(std::move(h)))
    150149
    151150 /*!
    152151 \brief 通过主消息队列向指定 Shell 对象转移控制权。
    153152 \since 早于 build 132
    154153 */
    155-inline PDefH(void, SetShellTo, const shared_ptr<Shell>& hShl,
    154+inline PDefH(void, SetShellTo, const shared_ptr<Shell>& h,
    156155 Messaging::Priority prior = Messaging::NormalPriority)
    157156 // NOTE: It would make the message loop in dead lock when called more
    158157 // than once specifying on same destination shell.
    159- ImplRet(PostMessage<SM_Set>(prior, hShl))
    158+ ImplRet(PostMessage<SM_Set>(prior, h))
    160159
    161160
    162161 /*!
    @@ -199,13 +198,13 @@
    199198 \warning 非线程安全。
    200199 \since build 307
    201200 */
    202-//@{
    201+//!@{
    203202 YF_API YB_ATTR_returns_nonnull const char*
    204203 TranslateTime(const std::tm&, const char* = DefaultTimeFormat);
    205204 //! \since build 563
    206205 YF_API YB_ATTR_returns_nonnull const char*
    207206 TranslateTime(const std::time_t&, const char* = DefaultTimeFormat);
    208-//@}
    207+//!@}
    209208
    210209
    211210 /*!
    @@ -252,10 +251,12 @@
    252251 \brief 取内部计数。
    253252 \since build 405
    254253 */
    255- //@{
    256- DefGetter(const ynothrow, std::chrono::nanoseconds, LastTick, last_tick)
    257- DefGetter(const ynothrow, std::chrono::nanoseconds, NowTick, now_tick)
    258- //@}
    254+ //!@{
    255+ YB_ATTR_nodiscard
    256+ DefGetter(const ynothrow, std::chrono::nanoseconds, LastTick, last_tick)
    257+ YB_ATTR_nodiscard
    258+ DefGetter(const ynothrow, std::chrono::nanoseconds, NowTick, now_tick)
    259+ //!@}
    259260
    260261 /*!
    261262 \brief 刷新:更新计数器内部计数。
    @@ -266,7 +267,7 @@
    266267 Refresh();
    267268 };
    268269
    269-//@}
    270+//!@}
    270271
    271272 namespace UI
    272273 {
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/NPL/Configuration.h
    --- a/YFramework/include/NPL/Configuration.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/NPL/Configuration.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2012-2016, 2019-2022 FrankHB.
    2+ © 2012-2016, 2019-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Configuration.h
    1212 \ingroup NPL
    1313 \brief 配置设置。
    14-\version r468
    14+\version r483
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 334
    1717 \par 创建时间:
    1818 2012-08-27 15:15:08 +0800
    1919 \par 修改时间:
    20- 2022-09-23 01:04 +0800
    20+ 2023-12-20 20:33 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -63,14 +63,14 @@
    6363 GlobalState::NoSourceInformation>(), yforward(obj), cs));
    6464 }
    6565
    66- DefGetter(const ynothrow, ContextState&, Context, cs)
    66+ YB_ATTR_nodiscard DefGetter(const ynothrow, ContextState&, Context, cs)
    6767 };
    6868
    6969 } // namespace A1;
    7070
    7171
    7272 /*!
    73-\brief 设置:使用 S 表达式存储外部状态。
    73+\brief 配置:使用 S 表达式存储外部状态。
    7474 \warning 非虚析构。
    7575 \since build 334
    7676 */
    @@ -116,7 +116,7 @@
    116116 {}
    117117 DefDeCopyMoveCtorAssignment(Configuration)
    118118
    119- DefGetter(const ynothrow, const ValueNode&, Root, root)
    119+ YB_ATTR_nodiscard DefGetter(const ynothrow, const ValueNode&, Root, root)
    120120
    121121 /*!
    122122 \brief 从文件输入设置。
    @@ -128,12 +128,13 @@
    128128 operator>>(std::istream&, Configuration&);
    129129
    130130 //! \since build 344
    131- DefGetter(const ynothrow, const ValueNode&, Node, root)
    131+ YB_ATTR_nodiscard DefGetter(const ynothrow, const ValueNode&, Node, root)
    132132 /*!
    133- \brief 取设置节点的右值引用。
    133+ \brief 取配置节点的右值引用。
    134134 \since build 341
    135135 */
    136- DefGetter(ynothrow, ValueNode&&, NodeRRef, std::move(root))
    136+ YB_ATTR_nodiscard
    137+ DefGetter(ynothrow, ValueNode&&, NodeRRef, std::move(root))
    137138
    138139 //! \since build 955
    139140 YB_ATTR_nodiscard YB_PURE
    @@ -142,13 +143,20 @@
    142143 };
    143144
    144145 /*!
    145-\brief 输出设置至输出流。
    146+\brief 输出配置至输出流。
    146147 \relates Configuration
    147148 \since build 600
    148149 */
    149150 YF_API std::ostream&
    150151 operator<<(std::ostream&, const Configuration&);
    151152
    153+/*!
    154+\brief 写 UTF-8 BOM 和配置到文件流。
    155+\since build 982
    156+*/
    157+YF_API void
    158+WriteNPLA1StreamWithBOM(std::ostream&, NPL::Configuration&&);
    159+
    152160 } // namespace NPL;
    153161
    154162 #endif
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YCLib/Basic.h
    --- /dev/null Thu Jan 01 00:00:00 1970 +0000
    +++ b/YFramework/include/YCLib/Basic.h Tue Feb 27 00:28:20 2024 +0800
    @@ -0,0 +1,112 @@
    1+/*
    2+ © 2010-2016, 2024 FrankHB.
    3+
    4+ This file is part of the YSLib project, and may only be used,
    5+ modified, and distributed under the terms of the YSLib project
    6+ license, LICENSE.TXT. By continuing to use, modify, or distribute
    7+ this file you indicate that you have read the license and
    8+ understand and accept it fully.
    9+*/
    10+
    11+/*! \file Basic.h
    12+\ingroup YCLib
    13+\brief 基本接口。
    14+\version r1245
    15+\author FrankHB <frankhb1989@gmail.com>
    16+\since build 593
    17+\par 创建时间:
    18+ 2024-02-25 21:45:35 +0800
    19+\par 修改时间:
    20+ 2024-02-26 01:10 +0800
    21+\par 文本编码:
    22+ UTF-8
    23+\par 模块名称:
    24+ YCLib::Basic
    25+*/
    26+
    27+
    28+#ifndef YCL_INC_Basic_h_
    29+#define YCL_INC_Basic_h_ 1
    30+
    31+#include "YModules.h"
    32+#include <ystdex/cstddef.h> // for ystdex::byte, ystdex::octet,
    33+// ystdex::ptrdiff_t, ystdex::size_t, ystdex::nullptr_t;
    34+#include <ystdex/base.h> // for ystdex::noncopyable, ystdex::nonmovable;
    35+#include <tuple> // for std::forward_as_tuple, std::get, std::ignore,
    36+// std::make_tuple, std::tie, std::tuple, std::tuple_cat;
    37+#include <utility> // for std::get, std::make_pair, std::pair:
    38+#include <ystdex/range.hpp> // for ystdex::size;
    39+
    40+/*! \defgroup TopLevelPlatformNamespaces Top-level Platform Namespaces
    41+\brief 顶级平台命名空间。
    42+\since build 652
    43+*/
    44+
    45+//! \ingroup TopLevelPlatformNamespaces
    46+namespace platform
    47+{
    48+
    49+//! \since build 593
    50+inline namespace basic_types
    51+{
    52+
    53+/*!
    54+\brief 平台通用数据类型。
    55+\since build 209
    56+*/
    57+//!@{
    58+//! \since build 417
    59+using ystdex::byte;
    60+//! \since build 417
    61+using ystdex::octet;
    62+using ystdex::ptrdiff_t;
    63+using ystdex::size_t;
    64+//! \since build 644
    65+using ystdex::nullptr_t;
    66+//!@}
    67+
    68+//! \since build 209
    69+using ystdex::noncopyable;
    70+//! \since build 373
    71+using ystdex::nonmovable;
    72+
    73+} // inline namespace basic_types;
    74+
    75+//! \since build 843
    76+inline namespace basic_utilities
    77+{
    78+
    79+using std::forward_as_tuple;
    80+using std::get;
    81+using std::ignore;
    82+using std::make_pair;
    83+using std::make_tuple;
    84+using std::pair;
    85+using std::tie;
    86+using std::tuple;
    87+using std::tuple_cat;
    88+
    89+//! \since build 546
    90+using std::begin;
    91+//! \since build 546
    92+using std::end;
    93+
    94+//! \since build 664
    95+using ystdex::size;
    96+
    97+} // inline namespace utilities;
    98+
    99+} // namespace platform;
    100+
    101+//! \ingroup TopLevelPlatformNamespaces
    102+namespace platform_ex
    103+{
    104+
    105+using namespace platform::basic_types;
    106+//! \since build 843
    107+using namespace platform::basic_utilities;
    108+
    109+} // namespace platform_ex;
    110+
    111+#endif
    112+
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YCLib/Container.h
    --- a/YFramework/include/YCLib/Container.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YCLib/Container.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2010-2016, 2018-2023 FrankHB.
    2+ © 2010-2016, 2018-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Container.h
    1212 \ingroup YCLib
    1313 \brief 容器、拟容器和适配器。
    14-\version r1476
    14+\version r1509
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 593
    1717 \par 创建时间:
    1818 2010-10-09 09:25:26 +0800
    1919 \par 修改时间:
    20- 2023-02-17 23:09 +0800
    20+ 2024-02-25 21:48 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -29,6 +29,7 @@
    2929 #define YCL_INC_Container_h_ 1
    3030
    3131 #include "YModules.h"
    32+#include YFM_YCLib_Basic // for pair;
    3233 #include <ystdex/cassert.h> // for YAssertNonnull;
    3334 #include <ystdex/memory_resource.h> // for ystdex::pmr;
    3435 #include <ystdex/functor.hpp> // for ystdex::less, ystdex::equal_to;
    @@ -74,30 +75,6 @@
    7475 //! \since build 843
    7576 namespace pmr = ystdex::pmr;
    7677
    77-//! \since build 843
    78-inline namespace basic_utilities
    79-{
    80-
    81-using std::forward_as_tuple;
    82-using std::get;
    83-using std::ignore;
    84-using std::make_pair;
    85-using std::make_tuple;
    86-using std::pair;
    87-using std::tie;
    88-using std::tuple;
    89-using std::tuple_cat;
    90-
    91-//! \since build 546
    92-using std::begin;
    93-//! \since build 546
    94-using std::end;
    95-
    96-//! \since build 664
    97-using ystdex::size;
    98-
    99-} // inline namespace utilities;
    100-
    10178 //! \since build 593
    10279 inline namespace containers
    10380 {
    @@ -149,12 +126,12 @@
    149126 // is an implementation detail.
    150127 template<typename _tKey, typename _tMapped, typename _fComp
    151128 = ystdex::less<_tKey>, class _tAlloc
    152- = default_allocator<std::pair<const _tKey, _tMapped>>>
    129+ = default_allocator<pair<const _tKey, _tMapped>>>
    153130 using map = ystdex::map<_tKey, _tMapped, _fComp, _tAlloc>;
    154131
    155132 template<typename _tKey, typename _tMapped, typename _fComp
    156133 = ystdex::less<_tKey>, class _tAlloc
    157- = default_allocator<std::pair<const _tKey, _tMapped>>>
    134+ = default_allocator<pair<const _tKey, _tMapped>>>
    158135 using multimap = stdd::multimap<_tKey, _tMapped, _fComp, _tAlloc>;
    159136
    160137 template<typename _tKey, typename _fComp = ystdex::less<_tKey>,
    @@ -168,13 +145,13 @@
    168145
    169146 template<typename _tKey, typename _tMapped,
    170147 typename _fHash = ystdex::hash<_tKey>, typename _fPred = ystdex::equal_to<
    171- _tKey>, class _tAlloc = default_allocator<std::pair<const _tKey, _tMapped>>>
    148+ _tKey>, class _tAlloc = default_allocator<pair<const _tKey, _tMapped>>>
    172149 using unordered_map
    173150 = ystdex::unordered_map<_tKey, _tMapped, _fHash, _fPred, _tAlloc>;
    174151
    175152 template<typename _tKey, typename _tMapped,
    176153 typename _fHash = ystdex::hash<_tKey>, typename _fPred = ystdex::equal_to<
    177- _tKey>, class _tAlloc = default_allocator<std::pair<const _tKey, _tMapped>>>
    154+ _tKey>, class _tAlloc = default_allocator<pair<const _tKey, _tMapped>>>
    178155 using unordered_multimap
    179156 = stdd::unordered_multimap<_tKey, _tMapped, _fHash, _fPred, _tAlloc>;
    180157
    @@ -311,7 +288,7 @@
    311288 # else
    312289 template<typename _tKey, typename _tMapped, typename _fComp
    313290 = ystdex::less<_tKey>, class _tAlloc
    314- = default_allocator<std::pair<const _tKey, _tMapped>>>
    291+ = default_allocator<pair<const _tKey, _tMapped>>>
    315292 using value_multimap = multimap<_tKey, _tMapped, _fComp, _tAlloc>;
    316293 # endif
    317294
    @@ -331,12 +308,12 @@
    331308
    332309 template<typename _tKey, typename _tMapped,
    333310 typename _fHash = ystdex::hash<_tKey>, typename _fPred = ystdex::equal_to<
    334- _tKey>, class _tAlloc = default_allocator<std::pair<const _tKey, _tMapped>>>
    311+ _tKey>, class _tAlloc = default_allocator<pair<const _tKey, _tMapped>>>
    335312 using linked_map = unordered_map<_tKey, _tMapped, _fHash, _fPred, _tAlloc>;
    336313
    337314 template<typename _tKey, typename _tMapped,
    338315 typename _fHash = ystdex::hash<_tKey>, typename _fPred = ystdex::equal_to<
    339- _tKey>, class _tAlloc = default_allocator<std::pair<const _tKey, _tMapped>>>
    316+ _tKey>, class _tAlloc = default_allocator<pair<const _tKey, _tMapped>>>
    340317 using linked_multimap
    341318 = unordered_multimap<_tKey, _tMapped, _fHash, _fPred, _tAlloc>;
    342319
    @@ -364,7 +341,7 @@
    364341 # else
    365342 template<typename _tKey, typename _tMapped, typename _fComp
    366343 = ystdex::less<_tKey>, class _tAlloc
    367- = default_allocator<std::pair<const _tKey, _tMapped>>>
    344+ = default_allocator<pair<const _tKey, _tMapped>>>
    368345 using ordered_value_multimap = multimap<_tKey, _tMapped, _fComp, _tAlloc>;
    369346 # endif
    370347
    @@ -384,12 +361,12 @@
    384361
    385362 template<typename _tKey, typename _tMapped, typename _fComp
    386363 = ystdex::less<_tKey>, class _tAlloc
    387- = default_allocator<std::pair<const _tKey, _tMapped>>>
    364+ = default_allocator<pair<const _tKey, _tMapped>>>
    388365 using ordered_linked_map = map<_tKey, _tMapped, _fComp, _tAlloc>;
    389366
    390367 template<typename _tKey, typename _tMapped, typename _fComp
    391368 = ystdex::less<_tKey>, class _tAlloc
    392- = default_allocator<std::pair<const _tKey, _tMapped>>>
    369+ = default_allocator<pair<const _tKey, _tMapped>>>
    393370 using ordered_linked_multimap = multimap<_tKey, _tMapped, _fComp, _tAlloc>;
    394371
    395372 template<typename _tKey, typename _fComp = ystdex::less<_tKey>,
    @@ -665,8 +642,6 @@
    665642 namespace platform_ex
    666643 {
    667644
    668-//! \since build 843
    669-using namespace platform::basic_utilities;
    670645 //! \since build 593
    671646 using namespace platform::containers;
    672647 //! \since build 843
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YCLib/JNI.h
    --- a/YFramework/include/YCLib/JNI.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YCLib/JNI.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2014-2016, 2021, 2023 FrankHB.
    2+ © 2014-2016, 2021, 2023-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -12,13 +12,13 @@
    1212 \ingroup YCLib
    1313 \ingroup YCLibLimitedPlatforms
    1414 \brief Java 本机接口包装。
    15-\version r307
    15+\version r309
    1616 \author FrankHB <frankhb1989@gmail.com>
    1717 \since build 552
    1818 \par 创建时间:
    1919 2014-11-11 03:20:32 +0800
    2020 \par 修改时间:
    21- 2023-07-23 23:01 +0800
    21+ 2024-02-26 23:01 +0800
    2222 \par 文本编码:
    2323 UTF-8
    2424 \par 模块名称:
    @@ -34,7 +34,7 @@
    3434 #if YF_Use_JNI
    3535 # include YFM_YCLib_Reference // for ystdex::remove_pointer_t, lref;
    3636 # include <jni.h> // for ::JavaVM, ::JNIEnv;
    37-# include YFM_YCLib_Container // for pair;
    37+# include YFM_YCLib_Basic // for pair;
    3838 # include YFM_YBaseMacro // for DefGetter;
    3939 # include <stdexcept>
    4040 # include <utility>
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YCLib/Mutex.h
    --- a/YFramework/include/YCLib/Mutex.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YCLib/Mutex.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2014-2016 FrankHB.
    2+ © 2014-2016, 2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Mutex.h
    1212 \ingroup YCLib
    1313 \brief 互斥量。
    14-\version r164
    14+\version r170
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 551
    1717 \par 创建时间:
    1818 2014-11-04 05:17:14 +0800
    1919 \par 修改时间:
    20- 2016-09-01 00:08 +0800
    20+ 2024-02-26 00:59 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -29,7 +29,7 @@
    2929 #define YCL_INC_Mutex_h_ 1
    3030
    3131 #include "YModules.h"
    32-#include YFM_YCLib_YCommon
    32+#include YFM_YCLib_Platform // for YF_Multithread;
    3333 #include <ystdex/type_op.hpp> // for ystdex::cond_or_t, ystdex::or_,
    3434 // std::is_integral, std::is_pointer;
    3535 #if YF_Multithread == 1
    @@ -76,7 +76,7 @@
    7676 //! \since build 723
    7777 using ystdex::threading::shared_lockable_adaptor;
    7878 //! \since build 722
    79-//@{
    79+//!@{
    8080 #if YF_Multithread == 1 || !defined(NDEBUG)
    8181 yconstfn bool UseLockDebug(true);
    8282 #else
    @@ -88,7 +88,7 @@
    8888 template<class _tMutex>
    8989 using shared_lock_guard = ystdex::threading::lock_guard<_tMutex,
    9090 UseLockDebug, shared_lockable_adaptor<_tMutex>>;
    91-//@}
    91+//!@}
    9292
    9393 using YCL_Impl_Ns_Mutex::lock;
    9494 using YCL_Impl_Ns_Mutex::try_lock;
    @@ -100,7 +100,7 @@
    100100
    101101
    102102 //! \since build 723
    103-//@{
    103+//!@{
    104104 template<class _type, typename _tReference = ystdex::lref<_type>>
    105105 using AdaptedLock = ystdex::threading::lock_base<_type, UseLockDebug,
    106106 lockable_adaptor<_type, _tReference>>;
    @@ -131,7 +131,7 @@
    131131 template<class _type>
    132132 using SharedIndirectLockGuard
    133133 = SharedAdaptedLockGuard<_type, ystdex::indirect_ref_adaptor<_type>>;
    134-//@}
    134+//!@}
    135135
    136136 } // namespace Concurrency;
    137137
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YCLib/Platform.h
    --- a/YFramework/include/YCLib/Platform.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YCLib/Platform.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2016, 2018-2022 FrankHB.
    2+ © 2009-2016, 2018-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Platform.h
    1212 \ingroup YCLib
    1313 \brief 通用平台描述文件。
    14-\version r864
    14+\version r907
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since 早于 build 132
    1717 \par 创建时间:
    1818 2009-11-24 00:05:08 +0800
    1919 \par 修改时间:
    20- 2022-11-28 19:57 +0800
    20+ 2024-02-26 01:12 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -28,8 +28,7 @@
    2828 #ifndef YCL_INC_Platform_h_
    2929 #define YCL_INC_Platform_h_ 1
    3030
    31-#include <ystdex/cstddef.h> // for ystdex::byte, ystdex::octet,
    32-// ystdex::ptrdiff_t, ystdex::size_t, ystdex::nullptr_t;
    31+#include <ydef.h>
    3332
    3433 /*!
    3534 \def YF_DLL
    @@ -124,7 +123,7 @@
    124123 \note 只保证不同的目标平台值为不同的非零整数。具体值可能随版本不同变动。
    125124 \since build 458
    126125 */
    127-//@{
    126+//!@{
    128127 /*!
    129128 \brief DS 平台。
    130129 */
    @@ -216,9 +215,9 @@
    216215 // TODO: Precise architecture detection.
    217216 # define YF_Platform YF_Platform_Android_ARM
    218217 #elif defined(__linux__)
    219-# ifdef __i386__
    218+# ifdef __x86_64__
    220219 # define YF_Platform YF_Platform_Linux_x64
    221-# elif defined(__x86_64__)
    220+# elif defined(__i386__)
    222221 # define YF_Platform YF_Platform_Linux_x86
    223222 # endif
    224223 #elif defined(__APPLE__)
    @@ -231,11 +230,11 @@
    231230 //当前默认以 DS 作为目标平台。
    232231 # define YF_Platform YF_Platform_DS
    233232 #endif
    234-//@}
    233+//!@}
    235234
    236235
    237236 //! \since build 553
    238-//@{
    237+//!@{
    239238 /*!
    240239 \ingroup PlatformAPI
    241240 \def YCL_API_POSIXFileSystem
    @@ -267,7 +266,7 @@
    267266 \note 当前仅支持 \c posix 线程模型 G++ 。
    268267 \see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11953 。
    269268 */
    270-//@}
    269+//!@}
    271270
    272271 /*!
    273272 \ingroup PlatformOptionalFeatures
    @@ -332,6 +331,9 @@
    332331 #if YF_Platform == YF_Platform_DS
    333332 # define YCL_DS 1
    334333 # define YF_Hosted 0
    334+// NOTE: The platform %DS does not conforms to POSIX, but there are many APIs
    335+// largely compliant to POSIX.1. However, there are subtle differences not
    336+// conforming to POSIX, see Docuemntation::YCLib.
    335337 # define YCL_API_POSIXFileSystem 1
    336338 # define YCL_API_Has_dirent_h 1
    337339 # define YCL_API_Has_unistd_h 1
    @@ -415,45 +417,5 @@
    415417 # define YF_Multithread 0
    416418 #endif
    417419
    418-/*! \defgroup TopLevelPlatformNamespaces Top-level Platform Namespaces
    419-\brief 顶级平台命名空间。
    420-\since build 652
    421-*/
    422-
    423-//! \ingroup TopLevelPlatformNamespaces
    424-namespace platform
    425-{
    426-
    427-//! \since build 593
    428-inline namespace basic_types
    429-{
    430-
    431-/*!
    432-\brief 平台通用数据类型。
    433-\since build 209
    434-*/
    435-//@{
    436-//! \since build 417
    437-using ystdex::byte;
    438-//! \since build 417
    439-using ystdex::octet;
    440-using ystdex::ptrdiff_t;
    441-using ystdex::size_t;
    442-//! \since build 644
    443-using ystdex::nullptr_t;
    444-//@}
    445-
    446-} // inline namespace basic_types;
    447-
    448-} // namespace platform;
    449-
    450-//! \ingroup TopLevelPlatformNamespaces
    451-namespace platform_ex
    452-{
    453-
    454-using namespace platform::basic_types;
    455-
    456-} // namespace platform_ex;
    457-
    458420 #endif
    459421
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YCLib/Timer.h
    --- a/YFramework/include/YCLib/Timer.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YCLib/Timer.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2012-2014 FrankHB.
    2+ © 2012-2014, 2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Timer.h
    1212 \ingroup YCLib
    1313 \brief 平台相关的计时器接口。
    14-\version r100
    14+\version r103
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 313
    1717 \par 创建时间:
    1818 2012-06-01 14:42:34 +0800
    1919 \par 修改时间:
    20- 2014-11-21 12:50 +0800
    20+ 2024-02-26 01:03 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -29,7 +29,8 @@
    2929 #define YCL_INC_Timer_h_ 1
    3030
    3131 #include "YModules.h"
    32-#include YFM_YCLib_YCommon
    32+#include YFM_YCLib_Platform
    33+#include <cstdint> // for std::uint32_t, std::uint64_t;
    3334
    3435 namespace platform
    3536 {
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YCLib/XCB.h
    --- a/YFramework/include/YCLib/XCB.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YCLib/XCB.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2014-2015, 2018, 2021-2022 FrankHB.
    2+ © 2014-2015, 2018, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -12,13 +12,13 @@
    1212 \ingroup YCLib
    1313 \ingroup YCLibLimitedPlatforms
    1414 \brief XCB GUI 接口。
    15-\version r414
    15+\version r468
    1616 \author FrankHB <frankhb1989@gmail.com>
    1717 \since build 560
    1818 \par 创建时间:
    1919 2014-12-14 14:40:34 +0800
    2020 \par 修改时间:
    21- 2022-01-25 05:02 +0800
    21+ 2023-12-20 20:15 +0800
    2222 \par 文本编码:
    2323 UTF-8
    2424 \par 模块名称:
    @@ -33,19 +33,18 @@
    3333 #include YFM_YCLib_Platform
    3434 #if YF_Use_XCB
    3535 // #include <xcb/xcb.h>
    36-# include YFM_YCLib_Host // for platform::string_view,
    37-// platform_ex::Exception;
    38-# include <ystdex/base.h> // for ystdex::noncopyable, ystdex::nonmovable;
    36+# include YFM_YCLib_Host // for string_view, std::uint8_t, noncopyable,
    37+// nonmovable, string, platform_ex::Exception;
    3938 # include YFM_YCLib_Debug // for platform::Deref;
    40-# include YFM_YSLib_Core_YGraphics
    41-# include <atomic>
    39+# include YFM_YSLib_Core_YGraphics // for YSLib::Drawing::Rect,
    40+// YSLib::Drawing::Point, YSLib::Drawing::Size, YSLib::Drawing::ConstGraphics;
    4241
    4342 //! \since build 560
    44-//@{
    43+//!@{
    4544 struct xcb_connection_t;
    4645 struct xcb_auth_info_t;
    4746 struct xcb_setup_t;
    48-//@}
    47+//!@}
    4948 //! \since build 561
    5049 struct xcb_screen_t;
    5150
    @@ -56,29 +55,26 @@
    5655 namespace XCB
    5756 {
    5857
    59-//! \since build 659
    60-using platform::string_view;
    61-
    6258 //! \brief XCB 异常。
    6359 class YF_API XCBException : public Exception
    6460 {
    6561 private:
    6662 //! \since build 561
    67- //@{
    63+ //!@{
    6864 std::uint8_t error_code;
    6965 std::uint16_t sequence;
    7066 std::uint32_t resource_id;
    7167 std::uint16_t minor_code;
    7268 std::uint8_t major_code;
    7369 std::uint32_t full_sequence;
    74- //@}
    70+ //!@}
    7571
    7672 public:
    7773 /*!
    7874 \pre 间接断言:字符串参数对应的数据指针非空。
    7975 \since build 659
    8076 */
    81- //@{
    77+ //!@{
    8278 YB_NONNULL(2)
    8379 XCBException(const char*, std::uint8_t, std::uint8_t, std::uint16_t,
    8480 std::uint32_t, std::uint16_t, std::uint8_t, std::uint32_t,
    @@ -86,7 +82,7 @@
    8682 XCBException(string_view, std::uint8_t, std::uint8_t, std::uint16_t,
    8783 std::uint32_t, std::uint16_t, std::uint8_t, std::uint32_t,
    8884 YSLib::RecordLevel = YSLib::Emergent);
    89- //@}
    85+ //!@}
    9086 //! \since build 845
    9187 DefDeCopyCtor(XCBException)
    9288 /*!
    @@ -99,16 +95,22 @@
    9995 DefDeCopyAssignment(XCBException)
    10096
    10197 //! \since build 561
    102- //@{
    103- DefGetter(const ynothrow, std::uint8_t, ErrorCode, error_code)
    104- DefGetter(const ynothrow, std::uint8_t, FullSequence, full_sequence)
    105- DefGetter(const ynothrow, std::uint8_t, MajorCode, major_code)
    106- DefGetter(const ynothrow, std::uint16_t, MinorCode, minor_code)
    107- DefGetter(const ynothrow, std::uint8_t, ResponseType,
    98+ //!@{
    99+ YB_ATTR_nodiscard
    100+ DefGetter(const ynothrow, std::uint8_t, ErrorCode, error_code)
    101+ YB_ATTR_nodiscard
    102+ DefGetter(const ynothrow, std::uint8_t, FullSequence, full_sequence)
    103+ YB_ATTR_nodiscard
    104+ DefGetter(const ynothrow, std::uint8_t, MajorCode, major_code)
    105+ YB_ATTR_nodiscard
    106+ DefGetter(const ynothrow, std::uint16_t, MinorCode, minor_code)
    107+ YB_ATTR_nodiscard DefGetter(const ynothrow, std::uint8_t, ResponseType,
    108108 std::uint8_t(code().value()))
    109- DefGetter(const ynothrow, std::uint32_t, ResourceID, resource_id)
    110- DefGetter(const ynothrow, std::uint16_t, Sequence, sequence)
    111- //@}
    109+ YB_ATTR_nodiscard
    110+ DefGetter(const ynothrow, std::uint32_t, ResourceID, resource_id)
    111+ YB_ATTR_nodiscard
    112+ DefGetter(const ynothrow, std::uint16_t, Sequence, sequence)
    113+ //!@}
    112114 };
    113115
    114116
    @@ -125,10 +127,10 @@
    125127 using tidy_ptr<::xcb_connection_t>::tidy_ptr;
    126128 DefDeCopyMoveCtorAssignment(ConnectionReference)
    127129
    128- //! \pre 间接断言: \c bool(*this) 。
    129- //@{
    130+ //! \pre 间接断言:\c bool(*this) 。
    131+ //!@{
    130132 //! \brief 检查是否出现不可恢复的错误。
    131- DefPred(const ynothrow, OnError, GetError() != 0)
    133+ YB_ATTR_nodiscard DefPred(const ynothrow, OnError, GetError() != 0)
    132134
    133135 /*!
    134136 \brief 取可能出现的不可恢复的错误。
    @@ -158,7 +160,7 @@
    158160 //! \brief 生成标识(用于创建窗口等)。
    159161 std::uint32_t
    160162 GenerateID() const ynothrow;
    161- //@}
    163+ //!@}
    162164
    163165 //! \since build 845
    164166 using tidy_ptr<::xcb_connection_t>::get;
    @@ -170,7 +172,7 @@
    170172 \invariant \c get(*this) 。
    171173 */
    172174 class YF_API Connection final : private ConnectionReference,
    173- private ystdex::noncopyable, private ystdex::nonmovable
    175+ private noncopyable, private nonmovable
    174176 {
    175177 private:
    176178 //! \since build 593
    @@ -178,7 +180,7 @@
    178180
    179181 public:
    180182 //! \throw Exception 连接失败。
    181- //@{
    183+ //!@{
    182184 /*!
    183185 \brief 构造:使用显示名称和屏幕编号。
    184186 \note 直接传递至 \c ::xcb_connect 。
    @@ -197,11 +199,11 @@
    197199 */
    198200 explicit
    199201 Connection(ConnectionReference);
    200- //@}
    202+ //!@}
    201203 //! \brief 析构:调用 \c ::xcb_disconnect 释放资源。
    202204 ~Connection();
    203205
    204- DefBoolNeg(explicit, !IsOnError())
    206+ YB_ATTR_nodiscard DefBoolNeg(YB_ATTR_nodiscard explicit, !IsOnError())
    205207
    206208 using ConnectionReference::IsOnError;
    207209
    @@ -237,7 +239,7 @@
    237239 explicit
    238240 Atom(::xcb_connection_t&, string_view, bool = {}) ynothrowv;
    239241
    240- DefCvt(const ynothrow, NativeType, atom)
    242+ YB_ATTR_nodiscard DefCvt(const ynothrow, NativeType, atom)
    241243 };
    242244
    243245
    @@ -247,7 +249,7 @@
    247249 \since build 563
    248250 */
    249251 YF_API Atom::NativeType
    250-LookupAtom(::xcb_connection_t&, const YSLib::string&);
    252+LookupAtom(::xcb_connection_t&, const string&);
    251253
    252254
    253255 /*!
    @@ -274,8 +276,9 @@
    274276 DefDeDtor(Drawable)
    275277
    276278 public:
    277- DefGetter(const ynothrow, ConnectionReference, ConnectionRef, conn_ref)
    278- DefGetter(const ynothrow, ID, ID, id)
    279+ YB_ATTR_nodiscard
    280+ DefGetter(const ynothrow, ConnectionReference, ConnectionRef, conn_ref)
    281+ YB_ATTR_nodiscard DefGetter(const ynothrow, ID, ID, id)
    279282
    280283 PDefH(::xcb_connection_t&, DerefConn, ) const ynothrow
    281284 ImplRet(platform::Deref(conn_ref.get()))
    @@ -290,7 +293,7 @@
    290293 \throw Exception 连接失败。
    291294 \since build 563
    292295 */
    293- //@{
    296+ //!@{
    294297 /*!
    295298 \brief 使用指定连接、边界矩形,以默认屏幕根节点作为父窗口。
    296299 \exception Exception 找不到 XCB 连接设定。
    @@ -302,7 +305,7 @@
    302305 const ::xcb_screen_t&);
    303306 //! \brief 使用指定连接、边界矩形和父窗口 ID 。
    304307 WindowData(::xcb_connection_t&, const YSLib::Drawing::Rect&, ID);
    305- //@}
    308+ //!@}
    306309 /*!
    307310 \brief 析构:销毁窗口。
    308311 \since build 845
    @@ -310,15 +313,17 @@
    310313 ~WindowData();
    311314
    312315 //! \since build 562
    313- //@{
    316+ //!@{
    314317 YSLib::Drawing::Rect
    315318 GetBounds() const;
    316- DefGetter(const, YSLib::Drawing::Point, Location, GetBounds().GetPoint())
    317- DefGetter(const, YSLib::Drawing::Size, Size, GetBounds().GetSize())
    319+ YB_ATTR_nodiscard DefGetter(const, YSLib::Drawing::Point, Location,
    320+ GetBounds().GetPoint())
    321+ YB_ATTR_nodiscard
    322+ DefGetter(const, YSLib::Drawing::Size, Size, GetBounds().GetSize())
    318323
    319324 void
    320325 SetBounds(const YSLib::Drawing::Rect&);
    321- //@}
    326+ //!@}
    322327
    323328 //! \since build 562
    324329 void
    @@ -328,14 +333,14 @@
    328333 Hide();
    329334
    330335 //! \since build 562
    331- //@{
    336+ //!@{
    332337 PDefH(void, Invalidate, )
    333338 ImplExpr(Invalidate(GetBounds()))
    334339 void
    335340 Invalidate(const YSLib::Drawing::Rect&);
    336341
    337342 //! \since build 563
    338- PDefH(Atom::NativeType, LookupAtom, const YSLib::string& name)
    343+ PDefH(Atom::NativeType, LookupAtom, const string& name)
    339344 ImplRet(XCB::LookupAtom(DerefConn(), name))
    340345
    341346 void
    @@ -346,7 +351,7 @@
    346351
    347352 void
    348353 Show();
    349- //@}
    354+ //!@}
    350355 };
    351356
    352357
    @@ -354,7 +359,7 @@
    354359 \brief 图形上下文。
    355360 \since build 563
    356361 */
    357-class YF_API GContext final : public Drawable, private YSLib::noncopyable
    362+class YF_API GContext final : public Drawable, private noncopyable
    358363 {
    359364 public:
    360365 GContext(::xcb_connection_t& c_ref) ynothrow
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YCLib/YCommon.h
    --- a/YFramework/include/YCLib/YCommon.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YCLib/YCommon.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2016, 2018-2023 FrankHB.
    2+ © 2009-2016, 2018-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YCommon.h
    1212 \ingroup YCLib
    1313 \brief 平台相关的公共组件无关函数与宏定义集合。
    14-\version r4160
    14+\version r4165
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 561
    1717 \par 创建时间:
    1818 2009-11-12 22:14:28 +0800
    1919 \par 修改时间:
    20- 2023-04-05 12:47 +0800
    20+ 2024-02-25 22:06 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -41,7 +41,7 @@
    4141 #include <ystdex/cstring.h> // for ystdex::uchar_t, ystdex::replace_cast;
    4242 #include YFM_YBaseMacro // for TryRet, CatchIgnore;
    4343 #include <exception> // for std::bad_alloc;
    44-#include YFM_YCLib_Container // for pair, vector, string;
    44+#include YFM_YCLib_Container // for vector, string, pair;
    4545
    4646 //! \brief 默认平台命名空间。
    4747 namespace platform
    @@ -64,8 +64,8 @@
    6464 {};
    6565
    6666 #if YB_IMPL_CLANGPP
    67-# pragma clang diagnostic push
    68-# pragma clang diagnostic ignored "-Wweak-vtables"
    67+ YB_Diag_Push
    68+ YB_Diag_Ignore(weak-vtables)
    6969 #endif
    7070
    7171 //! \brief 宿主平台标识的公共标记类型:指定任意宿主平台。
    @@ -116,7 +116,7 @@
    116116 #define YCL_Tag_constfn inline
    117117
    118118 #if YB_IMPL_CLANGPP
    119-# pragma clang diagnostic pop
    119+ YB_Diag_Pop
    120120 #endif
    121121
    122122 /*!
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YCLib/YModules.h
    --- a/YFramework/include/YCLib/YModules.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YCLib/YModules.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2013-2015 FrankHB.
    2+ © 2013-2015, 2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -21,13 +21,13 @@
    2121 /*! \file YModules.h
    2222 \ingroup YCLib
    2323 \brief YCLib 库模块配置文件。
    24-\version r106
    24+\version r121
    2525 \author FrankHB <frankhb1989@gmail.com>
    2626 \since build 462
    2727 \par 创建时间:
    2828 2013-12-23 21:57:20 +0800
    2929 \par 修改时间:
    30- 2015-09-12 19:56 +0800
    30+ 2024-02-25 21:53 +0800
    3131 \par 文本编码:
    3232 UTF-8
    3333 \par 模块名称:
    @@ -41,10 +41,18 @@
    4141 #include "../YModules.h"
    4242
    4343 //! \since build 461
    44-//@{
    44+//!@{
    4545 #define YFM_YCLib_Platform <YCLib/Platform.h>
    46+#define YFM_YCLib_NativeAPI <YCLib/NativeAPI.h>
    47+//! \since build 982
    48+#define YFM_YCLib_Basic <YCLib/Basic.h>
    49+//! \since build 593
    50+#define YFM_YCLib_Reference <YCLib/Reference.h>
    51+//! \since build 593
    52+#define YFM_YCLib_Container <YCLib/Container.h>
    53+//! \since build 551
    54+#define YFM_YCLib_Mutex <YCLib/Mutex.h>
    4655 #define YFM_YCLib_YCommon <YCLib/YCommon.h>
    47-#define YFM_YCLib_NativeAPI <YCLib/NativeAPI.h>
    4856 #define YFM_YCLib_Debug <YCLib/Debug.h>
    4957 //! \since build 615
    5058 #define YFM_YCLib_FileIO <YCLib/FileIO.h>
    @@ -54,12 +62,6 @@
    5462 #define YFM_YCLib_Keys <YCLib/Keys.h>
    5563 #define YFM_YCLib_Input <YCLib/Input.h>
    5664 #define YFM_YCLib_MemoryMapping <YCLib/MemoryMapping.h>
    57-//! \since build 593
    58-#define YFM_YCLib_Container <YCLib/Container.h>
    59-//! \since build 551
    60-#define YFM_YCLib_Mutex <YCLib/Mutex.h>
    61-//! \since build 593
    62-#define YFM_YCLib_Reference <YCLib/Reference.h>
    6365
    6466 //! \since build 492
    6567 #define YFM_YCLib_Host <YCLib/Host.h>
    @@ -76,16 +78,16 @@
    7678 #define YFM_DS_YCLib_DSVideo <YCLib/DSVideo.h>
    7779 //! \since build 604
    7880 #define YFM_DS_YCLib_DSIO <YCLib/DSIO.h>
    79-//@}
    81+//!@}
    8082
    8183 //! \since build 633
    82-//@{
    84+//!@{
    8385 #define YFM_Win32_YCLib_MinGW32 <YCLib/MinGW32.h>
    8486 #define YFM_Win32_YCLib_Registry <YCLib/Registry.h>
    8587 #define YFM_Win32_YCLib_COM <YCLib/COM.h>
    8688 #define YFM_Win32_YCLib_NLS <YCLib/NLS.h>
    8789 #define YFM_Win32_YCLib_Consoles <YCLib/Consoles.h>
    88-//@}
    90+//!@}
    8991 //! \since build 492
    9092 #define YFM_Android_YCLib_Android <YCLib/Android.h>
    9193
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/Adaptor/YAdaptor.h
    --- a/YFramework/include/YSLib/Adaptor/YAdaptor.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/Adaptor/YAdaptor.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2010-2023 FrankHB.
    2+ © 2010-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YAdaptor.h
    1212 \ingroup Adaptor
    1313 \brief 外部库关联。
    14-\version r2571
    14+\version r2612
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since 早于 build 132
    1717 \par 创建时间:
    1818 2010-02-22 20:16:21 +0800
    1919 \par 修改时间:
    20- 2023-10-13 01:07 +0800
    20+ 2024-02-24 10:35 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -77,6 +77,13 @@
    7777 using namespace platform::references;
    7878 //!@}
    7979
    80+//! \since build 650
    81+using ystdex::_t;
    82+
    83+//! \since build 939
    84+using ystdex::trivial_swap;
    85+//! \since build 939
    86+using ystdex::trivial_swap_t;
    8087
    8188 //! \note 替代较新版本的 std 对应接口,以不被当前实现模式支持的旧版 std 限制。
    8289 //!@{
    @@ -100,6 +107,33 @@
    100107 using platform::wstring_view;
    101108 //!@}
    102109 //!@}
    110+//! \since build 836
    111+using platform::string_view_t;
    112+
    113+// !\note 可能使用 ADL 。
    114+//!@{
    115+//! \since build 861
    116+using ystdex::make_string_view;
    117+
    118+//! \since build 896
    119+using platform::to_pmr_string;
    120+//! \since build 861
    121+using platform::to_std_string;
    122+
    123+//! \since build 593
    124+using platform::to_string;
    125+//! \since build 593
    126+using platform::to_wstring;
    127+//!@}
    128+
    129+/*!
    130+\note 假定不使用 ADL 。
    131+\since build 593
    132+*/
    133+//!@{
    134+using platform::sfmt;
    135+using platform::vsfmt;
    136+//!@}
    103137
    104138 /*!
    105139 \note 替代标准库的类模板和类。
    @@ -133,45 +167,6 @@
    133167 //!@}
    134168
    135169
    136-//! \since build 650
    137-using ystdex::_t;
    138-//! \since build 209
    139-using ystdex::noncopyable;
    140-//! \since build 373
    141-using ystdex::nonmovable;
    142-
    143-//! \since build 939
    144-using ystdex::trivial_swap;
    145-//! \since build 939
    146-using ystdex::trivial_swap_t;
    147-
    148-//! \since build 836
    149-using platform::string_view_t;
    150-
    151-//! \since build 593
    152-//!@{
    153-//! \note 假定不使用 ADL 。
    154-//!@{
    155-using platform::sfmt;
    156-using platform::vsfmt;
    157-//!@}
    158-
    159-// !\note 可能使用 ADL 。
    160-//!@{
    161-//! \since build 861
    162-using ystdex::make_string_view;
    163-
    164-//! \since build 896
    165-using platform::to_pmr_string;
    166-//! \since build 861
    167-using platform::to_std_string;
    168-
    169-using platform::to_string;
    170-using platform::to_wstring;
    171-//!@}
    172-//!@}
    173-
    174-
    175170 /*!
    176171 \brief 解锁删除器:使用线程模型对应的互斥量和锁。
    177172 \since build 590
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/Core/YApplication.h
    --- a/YFramework/include/YSLib/Core/YApplication.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/Core/YApplication.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2016, 2018-2019, 2022 FrankHB.
    2+ © 2009-2016, 2018-2019, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YApplication.h
    1212 \ingroup Core
    1313 \brief 系统资源和应用程序实例抽象。
    14-\version r1802
    14+\version r1813
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 577
    1717 \par 创建时间:
    1818 2009-12-27 17:12:27 +0800
    1919 \par 修改时间:
    20- 2022-11-21 07:14 +0800
    20+ 2023-12-20 20:17 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -91,7 +91,8 @@
    9191 ~Application() override;
    9292
    9393 //! \brief 取得线程空间中当前运行的 Shell 的句柄。
    94- DefGetter(const ynothrow, shared_ptr<Shell>, ShellHandle, hShell)
    94+ YB_ATTR_nodiscard
    95+ DefGetter(const ynothrow, shared_ptr<Shell>, ShellHandle, hShell)
    9596
    9697 /*!
    9798 \brief 执行消息队列操作。
    @@ -112,7 +113,7 @@
    112113 \note 线程安全:全局互斥访问。
    113114 \since build 693
    114115 */
    115- //@{
    116+ //!@{
    116117 template<typename _tParam>
    117118 void
    118119 AddExit(_tParam&& arg)
    @@ -153,7 +154,7 @@
    153154 return {YSLib::unchecked_any_cast<ystdex::decay_t<_tParam>>(
    154155 &on_exit.top()), std::move(lck)};
    155156 }
    156- //@}
    157+ //!@}
    157158
    158159 /*!
    159160 \brief 处理消息:分发消息。
    @@ -218,11 +219,12 @@
    218219 /*!
    219220 \ingroup helper_functions
    220221 \brief 激活 Shell 对象:控制权转移给此对象以维持单线程运行。
    221-\pre 断言: <tt>bool(hShl)</tt> 。
    222+\pre 断言:\c bool(h) 。
    222223 \warning 不保证线程安全性。
    224+\since build 956
    223225 */
    224-inline PDefH(bool, Activate, const shared_ptr<Shell>& hShl)
    225- ImplRet(FetchAppInstance().Switch(shared_ptr<Shell>(hShl)))
    226+inline PDefH(bool, Activate, shared_ptr<Shell> h)
    227+ ImplRet(FetchAppInstance().Switch(std::move(h)))
    226228
    227229
    228230 /*!
    @@ -237,7 +239,7 @@
    237239 \note 线程安全。
    238240 \since build 550
    239241 */
    240-//@{
    242+//!@{
    241243 YF_API void
    242244 PostMessage(const Message&, Messaging::Priority);
    243245 inline PDefH(void, PostMessage, Messaging::ID id, Messaging::Priority prior,
    @@ -253,7 +255,7 @@
    253255 {
    254256 PostMessage(_vID, prior, ValueObject(target));
    255257 }
    256-//@}
    258+//!@}
    257259
    258260 /*!
    259261 \brief 以指定错误码和优先级发起 Shell 终止请求。
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/Core/YDevice.h
    --- a/YFramework/include/YSLib/Core/YDevice.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/Core/YDevice.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2015, 2019-2022 FrankHB.
    2+ © 2009-2015, 2019-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YDevice.h
    1212 \ingroup Core
    1313 \brief 平台无关的设备抽象层。
    14-\version r2102
    14+\version r2110
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 586
    1717 \par 创建时间:
    1818 2009-12-28 16:39:39 +0800
    1919 \par 修改时间:
    20- 2022-11-28 19:57 +0800
    20+ 2023-12-20 20:20 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -63,24 +63,24 @@
    6363 virtual ~GraphicDevice();
    6464
    6565 //! \since build 319
    66- //@{
    66+ //!@{
    6767 using Graphics::operator!;
    6868
    6969 using Graphics::operator bool;
    70- //@}
    70+ //!@}
    7171
    7272 /*!
    7373 \brief 取后备缓冲区。
    7474 \since build 407
    7575 */
    76- virtual DefGetter(const, unique_ptr<Drawing::IImage>, BackBuffer,
    77- unique_ptr<Drawing::IImage>())
    76+ YB_ATTR_nodiscard virtual DefGetter(const, unique_ptr<Drawing::IImage>,
    77+ BackBuffer, unique_ptr<Drawing::IImage>())
    7878 //! \since build 296
    79- //@{
    79+ //!@{
    8080 using Graphics::GetHeight;
    8181 using Graphics::GetWidth;
    8282 using Graphics::GetSize;
    83- //@}
    83+ //!@}
    8484
    8585 //! \since build 558
    8686 virtual DefSetter(, const Drawing::Size&, Size, sGraphics)
    @@ -113,7 +113,7 @@
    113113 //! \brief 虚析构:类定义外默认实现。
    114114 virtual ~KeyInputDevice();
    115115
    116- DefGetter(const ynothrow, KeyIndex, Width, width)
    116+ YB_ATTR_nodiscard DefGetter(const ynothrow, KeyIndex, Width, width)
    117117
    118118 //! \brief 按键映射。
    119119 virtual PDefH(KeyIndex, Map, KeyIndex code)
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/Core/YException.h
    --- a/YFramework/include/YSLib/Core/YException.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/Core/YException.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2010-2016, 2018-2022 FrankHB.
    2+ © 2010-2016, 2018-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YException.h
    1212 \ingroup Core
    1313 \brief 异常处理模块。
    14-\version r708
    14+\version r731
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 560
    1717 \par 创建时间:
    1818 2010-06-15 20:30:14 +0800
    1919 \par 修改时间:
    20- 2022-02-26 23:04 +0800
    20+ 2023-12-20 20:21 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -41,7 +41,7 @@
    4141 {
    4242
    4343 //! \ingroup exceptions
    44-//@{
    44+//!@{
    4545 //! \brief 一般运行时异常事件类。
    4646 using GeneralEvent = std::runtime_error;
    4747
    @@ -58,14 +58,14 @@
    5858 \brief 构造:使用异常字符串和记录等级。
    5959 \since build 643
    6060 */
    61- //@{
    61+ //!@{
    6262 //! \pre 间接断言:第一参数非空。
    6363 YB_NONNULL(2)
    6464 LoggedEvent(const char* = "", RecordLevel = Emergent);
    6565 //! \since build 921
    6666 LoggedEvent(const std::string&, RecordLevel = Emergent);
    6767 LoggedEvent(const string_view, RecordLevel = Emergent);
    68- //@}
    68+ //!@}
    6969 /*!
    7070 \brief 构造:使用一般异常事件对象和记录等级。
    7171 \since build 624
    @@ -80,7 +80,7 @@
    8080 ~LoggedEvent() override;
    8181
    8282 //! \since build 624
    83- DefGetter(const ynothrow, RecordLevel, Level, level)
    83+ YB_ATTR_nodiscard DefGetter(const ynothrow, RecordLevel, Level, level)
    8484 };
    8585
    8686
    @@ -117,10 +117,11 @@
    117117 ~FatalError() override;
    118118
    119119 //! \since build 646
    120- DefGetter(const ynothrow, string_view, Content, Deref(content))
    121- DefGetter(const ynothrow, const char*, Title, what())
    120+ YB_ATTR_nodiscard
    121+ DefGetter(const ynothrow, string_view, Content, Deref(content))
    122+ YB_ATTR_nodiscard DefGetter(const ynothrow, const char*, Title, what())
    122123 };
    123-//@}
    124+//!@}
    124125
    125126
    126127 /*!
    @@ -135,9 +136,9 @@
    135136
    136137
    137138 //! \sa YF_TraceRaw
    138-//@{
    139+//!@{
    139140 //! \note 若抛出异常,放弃层次信息,通过 YF_TraceRaw 打印错误消息。
    140-//@{
    141+//!@{
    141142 /*!
    142143 \brief 打印带有层次信息的需要保证无异常抛出的错误。
    143144 \pre 间接断言:第二参数非空。
    @@ -157,8 +158,8 @@
    157158 */
    158159 YF_API YB_NONNULL(1) void
    159160 PrintMessage(const char*, RecordLevel = Err, size_t level = 0) ynothrow;
    160-//@}
    161-//@}
    161+//!@}
    162+//!@}
    162163
    163164 /*!
    164165 \brief 追踪记录异常类型。
    @@ -171,7 +172,7 @@
    171172 TraceExceptionType(const std::exception&, RecordLevel = Err) ynothrow;
    172173
    173174 /*!
    174-\brief 使用 PrintMessage 展开和追踪异常类型和信息。
    175+\brief 使用 PrintMessage 提取和追踪异常类型和信息。
    175176 \sa ExtractException
    176177 \sa PrintMessage
    177178 \sa TraceExceptionType
    @@ -184,7 +185,7 @@
    184185 ExtractAndTrace(const std::exception&, RecordLevel = Err) ynothrow;
    185186
    186187 /*!
    187-\brief 展开指定层次的异常并使用指定参数记录。
    188+\brief 提取指定层次的异常并使用指定参数记录。
    188189 \sa PrintCriticalFor
    189190 \since build 888
    190191 */
    @@ -192,13 +193,13 @@
    192193 ExtractException(const ExtractedLevelPrinter&, const std::exception&,
    193194 size_t = 0) ynothrow;
    194195
    195-//! \return 是否发生并捕获异常。
    196-//@{
    197196 /*!
    198197 \brief 执行并尝试记录异常。
    198+\return 是否捕获和记录了异常。
    199199 \since build 829
    200200
    201201 对参数指定的函数求值,并使用最后一个参数追踪记录异常。
    202+只捕获和记录 ExceptionTracer 可记录的异常,即匹配 \c std::exception 的异常。
    202203 */
    203204 template<typename _func>
    204205 bool
    @@ -222,6 +223,7 @@
    222223
    223224 /*!
    224225 \brief 调用函数并尝试返回。
    226+\return 不经异常退出的调用结果或异常退出时默认初始化的结果。
    225227 \since build 702
    226228 */
    227229 template<typename _fCallable, typename... _tParams>
    @@ -237,6 +239,7 @@
    237239 /*!
    238240 \brief 调用函数并过滤宿主异常。
    239241 \note 使用 ADL TryExecute 。
    242+\return 是否发生并捕获异常。
    240243 \since build 624
    241244
    242245 对参数指定的函数求值,并捕获和追踪记录所有异常。
    @@ -249,10 +252,10 @@
    249252 ExceptionTracer trace = ExtractAndTrace) ynothrow
    250253 {
    251254 return !TryInvoke([=]{
    255+ // NOTE: This may throw excpections not match a %std::exception handler.
    252256 return !TryExecute(f, desc, lv, trace);
    253257 });
    254258 }
    255-//@}
    256259
    257260 } // namespace YSLib;
    258261
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/Service/File.h
    --- a/YFramework/include/YSLib/Service/File.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/Service/File.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2022 FrankHB.
    2+ © 2009-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file File.h
    1212 \ingroup Service
    1313 \brief 平台中立的文件抽象。
    14-\version r1697
    14+\version r1704
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 473
    1717 \par 创建时间:
    1818 2009-11-24 23:14:41 +0800
    1919 \par 修改时间:
    20- 2022-11-28 19:59 +0800
    20+ 2023-12-20 20:22 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -65,7 +65,7 @@
    6565 \throw std::system_error 文件存在且操作失败。
    6666 \since build 713
    6767 */
    68-//@{
    68+//!@{
    6969 template<typename _tChar>
    7070 YB_NONNULL(1) void
    7171 Remove(const _tChar* path)
    @@ -93,11 +93,11 @@
    9393 + IO::MakePathString(path) + '\'').c_str());
    9494 }
    9595 }
    96-//@}
    96+//!@}
    9797
    9898
    9999 //! \since build 724
    100-//@{
    100+//!@{
    101101 //! \brief 共享锁定的文件映射输入流。
    102102 class YF_API SharedInputMappedFileStream : private MappedFile,
    103103 private SharedIndirectLockGuard<const UniqueFile>, private ystdex::membuf,
    @@ -141,7 +141,7 @@
    141141 \pre 间接断言:指针参数非空。
    142142 \since build 838
    143143 */
    144- //@{
    144+ //!@{
    145145 /*!
    146146 \pre 指定打开模式的参数兼容。
    147147 \note 为避免误用,打开模式不提供默认参数。
    @@ -166,12 +166,12 @@
    166166 std::ios_base::openmode mode, mode_t pmode = DefaultPMode())
    167167 : UniqueLockedOutputFileStream(uopen(filename, {}, mode, pmode), mode)
    168168 {}
    169- //@}
    169+ //!@}
    170170
    171171 //! \brief 虚析构:类定义外默认实现。
    172172 ~UniqueLockedOutputFileStream() override;
    173173 };
    174-//@}
    174+//!@}
    175175
    176176 } // namespace IO;
    177177
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/Service/FileSystem.h
    --- a/YFramework/include/YSLib/Service/FileSystem.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/Service/FileSystem.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2010-2016, 2018-2023 FrankHB.
    2+ © 2010-2016, 2018-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file FileSystem.h
    1212 \ingroup Service
    1313 \brief 平台中立的文件系统抽象。
    14-\version r4073
    14+\version r4179
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 473
    1717 \par 创建时间:
    1818 2010-03-28 00:09:28 +0800
    1919 \par 修改时间:
    20- 2023-10-02 16:46 +0800
    20+ 2024-02-25 02:13 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -35,7 +35,8 @@
    3535 // std::is_convertible, std::is_constructible, u16string_view,
    3636 // std::enable_if_inconvertible_t, ystdex::enable_if_constructible_r_t,
    3737 // FetchCurrentWorkingDirectory, NodeCategory, IsDirectory, function,
    38-// FileDescriptor, mode_t, UniqueFile, IO::Remove;
    38+// FileDescriptor, mode_t, UniqueFile, IO::Remove, MappedFile,
    39+// std::throw_with_nested, GeneralEvent, std::string;
    3940 #include <ystdex/path.hpp> // for ystdex::path, ystdex::to_string,
    4041 // ystdex::to_string_d;
    4142 #include YFM_YSLib_Core_YString // for String;
    @@ -702,11 +703,11 @@
    702703 */
    703704 template<class _tString>
    704705 inline ystdex::remove_cvref_t<_tString>
    705-VerifyDirectoryPathTail(_tString&& str)
    706+VerifyDirectoryPathTail(_tString&& path)
    706707 {
    707- if(!(str.empty() || VerifyDirectory(str)))
    708- str.pop_back();
    709- return yforward(str);
    708+ if(!(path.empty() || VerifyDirectory(path)))
    709+ path.pop_back();
    710+ return yforward(path);
    710711 }
    711712
    712713 /*!
    @@ -1110,12 +1111,124 @@
    11101111 YF_API NodeCategory
    11111112 ClassifyNode(const Path&);
    11121113
    1114+
    1115+/*!
    1116+\brief 以参数指定的路径加载映射单元。
    1117+\throw GeneralEvent 嵌套异常:打开文件失败。
    1118+\since build 982
    1119+*/
    1120+template<typename _tParam, typename... _tParams>
    1121+YB_ATTR_nodiscard MappedFile
    1122+LoadMappedModule(_tParam&& path, _tParams&&... args)
    1123+{
    1124+ TryRet(MappedFile(yforward(args)...))
    1125+ CatchExpr(..., std::throw_with_nested(
    1126+ GeneralEvent("Loading module '" + std::string(path) + "' failed.")))
    1127+ YAssert(false, "Unreachable control found.");
    1128+}
    1129+
    11131130 } // namespace IO;
    11141131
    11151132 //! \since build 921
    11161133 namespace Deployment
    11171134 {
    11181135
    1136+//! \since build 982
    1137+//!@{
    1138+/*!
    1139+\brief 判断参数指示的位置是否符合局部 FHS 目录布局。
    1140+\see https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html 。
    1141+
    1142+以 POSIX 环境变量语法,预期的局部用户目录布局为:
    1143+$PREFIX/
    1144+$PREFIX/$BIN/
    1145+$PREFIX/lib/
    1146+$PREFIX/share/
    1147+其中,$PREFIX 为路径前缀,$BIN 是任意非空的目录名。
    1148+当参数指定 $PREFIX/$BIN/ 目录,且以上路径以目录存在时,检查通过。
    1149+假定检查目录时,布局不改变。
    1150+实现可分别检查各项路径,而不要求避免外部并发访问的竞争。
    1151+*/
    1152+//!@{
    1153+/*!
    1154+\note 参数指定路径前缀和其中的 bin 目录。
    1155+\warning 假定前缀指定目录是根目录且第二参数是其子目录,不检查参数之间的关系。
    1156+*/
    1157+YB_ATTR_nodiscard YF_API YB_PURE bool
    1158+CheckLocalFHSLayout(const IO::Path&, IO::Path);
    1159+//! \since build 899
    1160+//!@{
    1161+//! \note 参数指定程序映像的路径字符串。
    1162+YB_ATTR_nodiscard YF_API YB_PURE bool
    1163+CheckLocalFHSLayout(const string&);
    1164+
    1165+/*!
    1166+\brief 取指定程序映像的路径字符串对应的局部 fHS 根路径。
    1167+\sa CheckLocalFHSLayout
    1168+\sa FetchRootpath_string
    1169+
    1170+若框架根路径的 CheckLocalFHSLayout 检查通过,局部 fHS 根路径为对应的 $PREFIX ;
    1171+否则,局部 FHS 根路径路径为空。
    1172+*/
    1173+YB_ATTR_nodiscard YF_API YB_PURE IO::Path
    1174+GetLocalFHSRootPathOf(const string&);
    1175+//!@}
    1176+//!@}
    1177+
    1178+
    1179+/*!
    1180+\brief 根路径块:保存参数作为根路径初始化的路径信息。
    1181+\warning 非虚析构。
    1182+\note 可保存和检查 FHS 路径。
    1183+*/
    1184+class YF_API RootPathBlock
    1185+{
    1186+private:
    1187+ string saved;
    1188+ IO::Path current;
    1189+ IO::Path parent;
    1190+
    1191+public:
    1192+ RootPathBlock(const string& path)
    1193+ : RootPathBlock(string(path, path.get_allocator()))
    1194+ {}
    1195+ RootPathBlock(string&& path)
    1196+ : saved(std::move(path)), current(saved), parent(current / u"..")
    1197+ {}
    1198+ DefDeCopyMoveCtorAssignment(RootPathBlock)
    1199+
    1200+ DefGetter(const ynothrow, const IO::Path&, Parent, parent)
    1201+ /*!
    1202+ \brief 取保存的根路径字符串。
    1203+ \return 初始化根路径块的路径字符串。
    1204+ */
    1205+ DefGetter(const ynothrow, const string&, PathString, saved)
    1206+ /*!
    1207+ \brief 取保存的局部 FHS 根路径。
    1208+ \return 等价 Deployment::GetLocalFHSRootPathOf 应用到保存的根目录路径的值。
    1209+ \sa Deployment::GetLocalFHSRootPathOf
    1210+ \sa GetPathString
    1211+ */
    1212+ YB_ATTR_nodiscard YB_PURE const IO::Path&
    1213+ GetSavedLocalFHSRootPath() const;
    1214+
    1215+ /*!
    1216+ \brief 判断是否满足局部 FHS 路径。
    1217+ \sa CheckLocalFHSLayout
    1218+ */
    1219+ YB_ATTR_nodiscard YB_PURE bool
    1220+ HasLocalFHSLayout() const;
    1221+
    1222+ /*!
    1223+ \brief 取确保以分隔符结尾的当前工作目录路径。
    1224+ \note 可作为平台中立的布局根路径实现。
    1225+ */
    1226+ YB_ATTR_nodiscard YB_PURE static string
    1227+ FetchCurrentWorkingDirectoryPath(string::allocator_type = {});
    1228+};
    1229+//!@}
    1230+
    1231+
    11191232 /*!
    11201233 \note 第一参数和第二参数分别为目标和源路径。
    11211234 \see 工具脚本 \c SHBuild-common.sh 。
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/Service/ImageProcessing.h
    --- a/YFramework/include/YSLib/Service/ImageProcessing.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/Service/ImageProcessing.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2014-2016, 2022 FrankHB.
    2+ © 2014-2016, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file ImageProcessing.h
    1212 \ingroup Service
    1313 \brief 图像处理。
    14-\version r284
    14+\version r305
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 554
    1717 \par 创建时间:
    1818 2014-11-16 16:33:35 +0800
    1919 \par 修改时间:
    20- 2022-11-28 20:07 +0800
    20+ 2023-12-20 20:23 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -44,7 +44,7 @@
    4444 {
    4545
    4646 //! \since build 555
    47-//@{
    47+//!@{
    4848 //! \brief 图像缩放类型。
    4949 using ImageScale = ystdex::fixed_point<yimpl(std::uint32_t, 12U)>;
    5050
    @@ -54,7 +54,7 @@
    5454 */
    5555 YF_API CompactPixmap
    5656 Zoom(const HBitmap&, ImageScale);
    57-//@}
    57+//!@}
    5858
    5959
    6060 /*!
    @@ -94,7 +94,8 @@
    9494 //! \since build 555
    9595 DefDeMoveAssignment(ZoomedImageCache)
    9696
    97- DefGetter(const ynothrow, const Container&, Bitmaps, bitmaps)
    97+ YB_ATTR_nodiscard
    98+ DefGetter(const ynothrow, const Container&, Bitmaps, bitmaps)
    9899
    99100 //! \since build 555
    100101 shared_ptr<Image>
    @@ -141,7 +142,7 @@
    141142 \pre 断言:区域下限分量不大于区域上限分量。
    142143 \note 若起始缩放比例小于下限则由图像大小计算。
    143144 */
    144- //@{
    145+ //!@{
    145146 //! \brief 构造:使用指定路径、显示区域下限、显示区域上限和起始缩放比例。
    146147 template<typename _type,
    147148 yimpl(typename = ystdex::exclude_self_t<ImagePages, _type>)>
    @@ -151,23 +152,26 @@
    151152 {}
    152153 //! \brief 构造:使用指定缓存、显示区域下限、显示区域上限和起始缩放比例。
    153154 ImagePages(ZoomedImageCache&&, const Size&, const Size&, ImageScale);
    154- //@}
    155+ //!@}
    155156 DefDeMoveCtor(ImagePages)
    156157
    157158 DefDeMoveAssignment(ImagePages)
    158159
    159160 //! \since build 558
    160- DefGetterMem(const ynothrow, const vector<HBitmap>&, Bitmaps, cache)
    161+ YB_ATTR_nodiscard
    162+ DefGetterMem(const ynothrow, const vector<HBitmap>&, Bitmaps, cache)
    161163 //! \since build 557
    162- //@{
    163- DefGetter(const ynothrow, size_t, Count, cache.GetBitmaps().size())
    164- DefGetter(const ynothrow, size_t, Index, index)
    165- //@}
    164+ //!@{
    165+ YB_ATTR_nodiscard
    166+ DefGetter(const ynothrow, size_t, Count, cache.GetBitmaps().size())
    167+ YB_ATTR_nodiscard DefGetter(const ynothrow, size_t, Index, index)
    168+ //!@}
    166169 //! \since build 576
    167- DefGetter(const ynothrow, ImageScale, Scale, scale)
    168- DefGetter(const ynothrow, const Size&, ViewSize, view_size)
    170+ YB_ATTR_nodiscard DefGetter(const ynothrow, ImageScale, Scale, scale)
    171+ YB_ATTR_nodiscard
    172+ DefGetter(const ynothrow, const Size&, ViewSize, view_size)
    169173
    170- //! \pre 断言: <tt>Brush.ImagePtr</tt> 。
    174+ //! \pre 断言:\c Brush.ImagePtr 。
    171175 void
    172176 AdjustOffset(const Size&);
    173177
    @@ -178,7 +182,7 @@
    178182
    179183 public:
    180184 /*!
    181- \pre 断言: <tt>Brush.ImagePtr</tt> 。
    185+ \pre 断言:\c Brush.ImagePtr 。
    182186 \since build 554
    183187 */
    184188 void
    @@ -199,7 +203,7 @@
    199203 \return 是否成功进行了缩放。
    200204 \note 偏移量相对画刷左上角。
    201205 */
    202- //@{
    206+ //!@{
    203207 /*!
    204208 \brief 按指定的比例变化量和偏移量缩放。
    205209 \exception std::invalid_argument 异常中立:由 ZoomTo 抛出。
    @@ -226,7 +230,7 @@
    226230 */
    227231 bool
    228232 ZoomTo(float, const Point&);
    229- //@}
    233+ //!@}
    230234 };
    231235
    232236 } // namespace Drawing;
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/Service/YGDI.h
    --- a/YFramework/include/YSLib/Service/YGDI.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/Service/YGDI.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2017, 2019, 2021-2022 FrankHB.
    2+ © 2009-2017, 2019, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YGDI.h
    1212 \ingroup Service
    1313 \brief 平台无关的图形设备接口。
    14-\version r4055
    14+\version r4079
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 566
    1717 \par 创建时间:
    1818 2009-12-14 18:29:46 +0800
    1919 \par 修改时间:
    20- 2022-02-28 05:48 +0800
    20+ 2023-12-20 20:26 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -99,9 +99,9 @@
    9999 };
    100100
    101101 //! \since build 850
    102-//@{
    102+//!@{
    103103 //! \relates Padding
    104-//@{
    104+//!@{
    105105 //! \brief 加法逆元:对应分量调用一元 operator- 。
    106106 YB_ATTR_nodiscard YB_PURE yconstfn
    107107 PDefHOp(Padding, -, const Padding& x) ynothrow
    @@ -126,7 +126,7 @@
    126126 SPos(x.Top * ptrdiff_t(n)), SPos(x.Bottom * ptrdiff_t(n))))
    127127
    128128 //! \note 若边距过大,则矩形的宽或高可能为 0 。
    129-//@{
    129+//!@{
    130130 //! \brief 加法:缩小屏幕标准矩形,相对位置由指定边距决定。
    131131 YB_ATTR_nodiscard YF_API YB_PURE Rect
    132132 operator+(const Rect&, const Padding&) ynothrow;
    @@ -135,12 +135,12 @@
    135135 YB_ATTR_nodiscard YB_PURE inline
    136136 PDefHOp(Rect, -, const Rect& r, const Padding& m) ynothrow
    137137 ImplRet(r + -m)
    138-//@}
    139-//@}
    138+//!@}
    139+//!@}
    140140
    141141
    142142 //! \warning 不检查溢出。
    143-//@{
    143+//!@{
    144144 //! \brief 取水平边距和。
    145145 YB_ATTR_nodiscard YB_PURE yconstfn
    146146 PDefH(SDst, GetHorizontalOf, const Padding& m) ynothrowv
    @@ -150,7 +150,7 @@
    150150 YB_ATTR_nodiscard YB_PURE yconstfn
    151151 PDefH(SDst, GetVerticalOf, const Padding& m) ynothrowv
    152152 ImplRet(SDst(ystdex::max<SPos>(0, m.Top) + ystdex::max<SPos>(0, m.Bottom)))
    153-//@}
    153+//!@}
    154154
    155155
    156156 //! \brief 取内边界相对外边界的边距。
    @@ -182,7 +182,7 @@
    182182 */
    183183 YB_ATTR_nodiscard YF_API Point
    184184 ClipMargin(PaintContext&, const Padding&, const Size&) ynothrow;
    185-//@}
    185+//!@}
    186186
    187187
    188188 /*!
    @@ -213,7 +213,8 @@
    213213 using Graphics::GetWidth;
    214214 using Graphics::GetSize;
    215215 //! \since build 566
    216- DefGetter(const ynothrow ImplI(IImage), Graphics, Context, *this)
    216+ YB_ATTR_nodiscard
    217+ DefGetter(const ynothrow ImplI(IImage), Graphics, Context, *this)
    217218
    218219 //! \since build 409
    219220 DefClone(const ImplI(IImage), BasicImage)
    @@ -233,13 +234,13 @@
    233234 {
    234235 private:
    235236 //! \since build 566
    236- //@{
    237+ //!@{
    237238 using BaseType = GGraphics<unique_ptr<Pixel[]>>;
    238239
    239240 protected:
    240241 using BaseType::pBuffer;
    241242 using BaseType::sGraphics;
    242- //@}
    243+ //!@}
    243244
    244245 public:
    245246 /*!
    @@ -260,27 +261,27 @@
    260261 DefDeMoveCtor(CompactPixmap)
    261262
    262263 //! \since build 768
    263- //@{
    264+ //!@{
    264265 //! \brief 复制赋值:使用复制和交换。
    265266 PDefHOp(CompactPixmap&, =, const CompactPixmap& buf)
    266267 ImplRet(ystdex::copy_and_swap(*this, buf))
    267268 DefDeMoveAssignment(CompactPixmap)
    268- //@}
    269+ //!@}
    269270
    270271 //! \since build 566
    271- //@{
    272+ //!@{
    272273 using BaseType::operator!;
    273274
    274275 using BaseType::operator bool;
    275276
    276- DefGetter(const ynothrow, BitmapPtr, BufferPtr,
    277+ YB_ATTR_nodiscard DefGetter(const ynothrow, BitmapPtr, BufferPtr,
    277278 BaseType::GetBufferPtr().get())
    278279 using BaseType::GetHeight;
    279280 using BaseType::GetWidth;
    280281 using BaseType::GetSize;
    281- DefGetter(const ynothrow ImplI(IImage), Graphics, Context,
    282+ YB_ATTR_nodiscard DefGetter(const ynothrow ImplI(IImage), Graphics, Context,
    282283 Graphics(GetBufferPtr(), GetSize()))
    283- //@}
    284+ //!@}
    284285
    285286 /*!
    286287 \brief 设置内容。
    @@ -353,23 +354,24 @@
    353354 DefDeMoveCtor(CompactPixmapEx)
    354355
    355356 //! \since build 768
    356- //@{
    357+ //!@{
    357358 //! \brief 复制赋值:使用复制和交换。
    358359 PDefHOp(CompactPixmapEx&, =, const CompactPixmapEx& buf)
    359360 ImplRet(ystdex::copy_and_swap(*this, buf))
    360361 DefDeMoveAssignment(CompactPixmapEx)
    361- //@}
    362+ //!@}
    362363
    363364 /*!
    364365 \brief 取 Alpha 缓冲区的指针。
    365366 \since build 417
    366367 */
    367- DefGetter(const ynothrow, AlphaType*, BufferAlphaPtr, pBufferAlpha.get())
    368+ YB_ATTR_nodiscard DefGetter(const ynothrow, AlphaType*, BufferAlphaPtr,
    369+ pBufferAlpha.get())
    368370 /*!
    369371 \brief 取 Alpha 缓冲区占用空间。
    370372 \since build 407
    371373 */
    372- DefGetter(const ynothrow, size_t, SizeOfBufferAlpha,
    374+ YB_ATTR_nodiscard DefGetter(const ynothrow, size_t, SizeOfBufferAlpha,
    373375 sizeof(AlphaType) * size_t(GetAreaOf(GetSize())))
    374376
    375377 using CompactPixmap::SetSize;
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/UI/Loader.h
    --- a/YFramework/include/YSLib/UI/Loader.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/UI/Loader.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2013-2016, 2019-2020, 2022 FrankHB.
    2+ © 2013-2016, 2019-2020, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Loader.h
    1212 \ingroup UI
    1313 \brief 动态 GUI 加载。
    14-\version r684
    14+\version r696
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 433
    1717 \par 创建时间:
    1818 2013-08-01 20:37:16 +0800
    1919 \par 修改时间:
    20- 2022-09-22 23:33 +0800
    20+ 2023-12-23 16:44 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -29,7 +29,7 @@
    2929 #define YSL_INC_UI_Loader_h_ 1
    3030
    3131 #include "YModules.h"
    32-#include YFM_YSLib_UI_YUIContainer
    32+#include YFM_YSLib_UI_YUIContainer // for YSLib::make_unique;
    3333 #include YFM_YSLib_Core_ValueNode
    3434 #include <ystdex/cast.hpp> // for ystdex::polymorphic_downcast;
    3535 #include <ystdex/function.hpp> // for ystdex::unchecked_function;
    @@ -54,7 +54,7 @@
    5454 static unique_ptr<IWidget>
    5555 CreateUniqueWidget(_tParams&&... args)
    5656 {
    57- return make_unique<_tWidget>(yforward(args)...);
    57+ return YSLib::make_unique<_tWidget>(yforward(args)...);
    5858 }
    5959
    6060 /*!
    @@ -118,12 +118,12 @@
    118118
    119119 /*
    120120 \throw WidgetNotFound 没有找到指定名称的部件。
    121-\note 不抛出 std::out_of_range (已全部捕获并抛出为 WidgetNotFound )。
    121+\note 不抛出 \c std::out_of_range(已全部捕获并抛出为 WidgetNotFound )。
    122122 \since build 667
    123123 */
    124-//@{
    124+//!@{
    125125 //! \brief 按指定名称访问子部件节点。
    126-//@{
    126+//!@{
    127127 yconstfn PDefH(ValueNode&, AccessWidgetNode, ValueNode& nd)
    128128 ImplRet(nd)
    129129 template<typename... _tParams>
    @@ -135,13 +135,13 @@
    135135 CatchThrow(std::out_of_range&,
    136136 WidgetNotFound(node.GetName(), "Widget children not found."))
    137137 }
    138-//@}
    138+//!@}
    139139
    140140 /*!
    141141 \brief 按指定名称访问子部件。
    142142 \exception bad_any_cast 异常中立:由 Access 抛出。
    143143 */
    144-//@{
    144+//!@{
    145145 YF_API IWidget&
    146146 AccessWidget(const ValueNode&);
    147147 template<typename... _tParams>
    @@ -157,8 +157,8 @@
    157157 {
    158158 return dynamic_cast<_tWidget&>(AccessWidget(node, yforward(args)...));
    159159 }
    160-//@}
    161-//@}
    160+//!@}
    161+//!@}
    162162
    163163
    164164 //! \since build 494
    @@ -252,7 +252,7 @@
    252252 {}
    253253
    254254 //! \since build 888
    255- //@{
    255+ //!@{
    256256 //! \exception std::out_of_range 异常中立:找不到内部类型节点。
    257257 unique_ptr<IWidget>
    258258 DetectWidgetNode(const ValueNode&) const;
    @@ -278,7 +278,7 @@
    278278 */
    279279 ValueNode
    280280 TransformUILayout(const ValueNode&) const;
    281- //@}
    281+ //!@}
    282282 };
    283283
    284284
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/UI/YControl.h
    --- a/YFramework/include/YSLib/UI/YControl.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/UI/YControl.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2010-2016, 2019-2020, 2022 FrankHB.
    2+ © 2010-2016, 2019-2020, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YControl.h
    1212 \ingroup UI
    1313 \brief 样式无关的控件。
    14-\version r4880
    14+\version r4887
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 572
    1717 \par 创建时间:
    1818 2010-02-18 13:44:24 +0800
    1919 \par 修改时间:
    20- 2022-11-28 20:01 +0800
    20+ 2023-12-20 20:32 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -78,7 +78,7 @@
    7878 {}
    7979
    8080 //! \since build 581
    81- //@{
    81+ //!@{
    8282 PDefH(bool, IsEventEnabled, VisualEvent id) const ImplI(AController)
    8383 ImplRet(AController::IsEnabled() && !event_mask[id])
    8484
    @@ -88,9 +88,10 @@
    8888 //! \since build 850
    8989 YB_ATTR_nodiscard YB_PURE EventRef
    9090 GetEventRef(VisualEvent, EventItem(&)()) const override;
    91- //@}
    91+ //!@}
    9292 //! \brief 取事件映射表。
    93- DefGetter(const ynothrow, VisualEventMap&, EventMap, EventMap)
    93+ YB_ATTR_nodiscard
    94+ DefGetter(const ynothrow, VisualEventMap&, EventMap, EventMap)
    9495
    9596 //! \since build 581
    9697 PDefH(void, SetEventEnabled, VisualEvent id, bool b) ImplI(AController)
    @@ -290,8 +291,8 @@
    290291 /*!
    291292 \brief 构造:使用指定边界,无背景。
    292293 \note 使用扩展控件事件表加载的事件处理器。
    293- \note 加载事件处理器: Move 、 Resize 、 GotFocus 和 LostFocus 时自动无效化。
    294- \note 加载事件处理器: OnTouchDown_RequestToFrontFocused 。
    294+ \note 加载事件处理器:Move 、 Resize 、 GotFocus 和 LostFocus 时自动无效化。
    295+ \note 加载事件处理器:OnTouchDown_RequestToFrontFocused 。
    295296 \sa Widget::Widget
    296297 \since build 485
    297298 */
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/include/YSLib/UI/YUIContainer.h
    --- a/YFramework/include/YSLib/UI/YUIContainer.h Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/include/YSLib/UI/YUIContainer.h Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2011-2016, 2019-2020, 2022 FrankHB.
    2+ © 2011-2016, 2019-2020, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YUIContainer.h
    1212 \ingroup UI
    1313 \brief 样式无关的 GUI 容器。
    14-\version r2159
    14+\version r2172
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 563
    1717 \par 创建时间:
    1818 2011-01-22 07:59:47 +0800
    1919 \par 修改时间:
    20- 2022-11-28 20:00 +0800
    20+ 2023-12-20 20:35 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -174,14 +174,14 @@
    174174
    175175
    176176 //! \since build 555
    177-//@{
    177+//!@{
    178178 //! \brief Z 顺序类型:覆盖顺序,值越大表示越接近顶层。
    179179 using ZOrder = std::uint8_t;
    180180 //! \brief 默认 Z 顺序值。
    181181 const ZOrder DefaultZOrder(64);
    182182 //! \brief 默认窗口 Z 顺序值。
    183183 const ZOrder DefaultWindowZOrder(128);
    184-//@}
    184+//!@}
    185185
    186186
    187187 /*!
    @@ -219,7 +219,7 @@
    219219
    220220 public:
    221221 //! \since build 537
    222- //@{
    222+ //!@{
    223223 //! \brief 无参数构造:默认实现。
    224224 DefDeCtor(MLinearUIContainer)
    225225 DefDeMoveCtor(MLinearUIContainer)
    @@ -239,20 +239,20 @@
    239239 */
    240240 bool
    241241 operator-=(IWidget&);
    242- //@}
    242+ //!@}
    243243
    244244 /*!
    245245 \brief 取指定索引的部件引用。
    246246 \pre 断言:参数小于部件数。
    247247 */
    248- //@{
    248+ //!@{
    249249 PDefHOp(IWidget&, [], size_t idx) ynothrowv
    250250 ImplRet(YAssert(idx < GetCount(), "Index is out of range."),
    251251 vWidgets[idx])
    252252 PDefHOp(IWidget&, [], size_t idx) const ynothrowv
    253253 ImplRet(YAssert(idx < GetCount(), "Index is out of range."),
    254254 vWidgets[idx])
    255- //@}
    255+ //!@}
    256256
    257257 /*!
    258258 \brief 判断是否包含指定部件。
    @@ -265,7 +265,7 @@
    265265 \brief 取部件数。
    266266 \since build 495
    267267 */
    268- DefGetter(const ynothrow, size_t, Count, vWidgets.size())
    268+ YB_ATTR_nodiscard DefGetter(const ynothrow, size_t, Count, vWidgets.size())
    269269
    270270 /*!
    271271 \brief 查找部件。
    @@ -287,12 +287,12 @@
    287287 \exception std::out_of_range 异常中立:由 vWidgets.at 抛出。
    288288 \since build 563
    289289 */
    290- //@{
    290+ //!@{
    291291 PDefH(IWidget&, at, size_t idx)
    292292 ImplRet(vWidgets.at(idx))
    293293 PDefH(IWidget&, at, size_t idx) const
    294294 ImplRet(vWidgets.at(idx))
    295- //@}
    295+ //!@}
    296296
    297297 iterator
    298298 begin();
    @@ -337,7 +337,7 @@
    337337
    338338 public:
    339339 //! \since build 537
    340- //@{
    340+ //!@{
    341341 /*!
    342342 \brief 无参数构造:默认实现。
    343343 */
    @@ -361,7 +361,7 @@
    361361 */
    362362 bool
    363363 operator-=(IWidget&);
    364- //@}
    364+ //!@}
    365365
    366366 /*!
    367367 \brief 判断是否包含指定部件。
    @@ -373,7 +373,7 @@
    373373 \brief 取部件数。
    374374 \since build 495
    375375 */
    376- DefGetter(const ynothrow, size_t, Count, mWidgets.size())
    376+ YB_ATTR_nodiscard DefGetter(const ynothrow, size_t, Count, mWidgets.size())
    377377
    378378 /*!
    379379 \brief 向部件组添加部件。
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/Helper/Initialization.cpp
    --- a/YFramework/source/Helper/Initialization.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/Helper/Initialization.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -11,13 +11,13 @@
    1111 /*! \file Initialization.cpp
    1212 \ingroup Helper
    1313 \brief 框架初始化。
    14-\version r4118
    14+\version r4326
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since 早于 build 132
    1717 \par 创建时间:
    1818 2009-10-21 23:15:08 +0800
    1919 \par 修改时间:
    20- 2023-10-02 16:47 +0800
    20+ 2024-02-25 03:57 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -26,16 +26,13 @@
    2626
    2727
    2828 #include "Helper/YModules.h"
    29-#include YFM_Helper_Initialization // for IO::FetchSeparator,
    30-// FetchCurrentWorkingDirectory, IO::MaxPathLength, GeneralEvent,
    31-// pmr::new_delete_resource_t, ystdex::nptr, UniqueLockedOutputFileStream,
    32-// std::ios_base, air, value_map, mutex, lock_guard, IO::EnsureDirectory,
    33-// IO::VerifyDirectories, PerformKeyAction, IO::TraverseChildren, NodeCategory,
    34-// NativePathView, IsDirectory, FontPath, String;
    35-#if !(YCL_Win32 || YCL_Linux)
    36-# include <ystdex/string.hpp> // for ystdex::rtrim;
    37-# include YFM_YCLib_FileSystem // for platform::EndsWithNonSeperator;
    38-#endif
    29+#include YFM_Helper_Initialization // for IO::Path, Deployment::RootPathBlock,
    30+// IO::FetchSeparator, GeneralEvent, pmr::new_delete_resource_t, ystdex::nptr,
    31+// byte, size_t, SharedInputMappedFileStream, UniqueLockedOutputFileStream,
    32+// IO::LoadMappedModule, std::ios_base, air, value_map, mutex, lock_guard,
    33+// IO::EnsureDirectory, IO::VerifyDirectories, PerformKeyAction,
    34+// IO::TraverseChildren, NodeCategory, NativePathView, IsDirectory, FontPath,
    35+// String;
    3936 #if YCL_Win32
    4037 # include YFM_Win32_YCLib_NLS // for platform_ex::FetchModuleFileName,
    4138 // platform_ex::FetchDBCSOffset, platform_ex::WCSToUTF8,
    @@ -44,14 +41,13 @@
    4441 #include YFM_CHRLib_MappingEx // for CHRLib::cp113_lkp;
    4542 #include YFM_NPL_Configuration // for NPL::Configuration, A1::NodeLoader;
    4643 #include YFM_YSLib_Service_TextFile // for Text::BOM_UTF_8, Text::CheckBOM;
    47-#include <ystdex/string.hpp> // for ystdex::write_literal, ystdex::sfmt;
    44+#include <ystdex/string.hpp> // for ystdex::sfmt;
    4845 #include <cerrno> // for errno;
    4946 #include <ystdex/scope_guard.hpp> // for ystdex::swap_guard;
    5047 #include YFM_YSLib_Adaptor_YAdaptor // for FetchEnvironmentVariable;
    5148 #include YFM_Helper_GUIApplication // for FetchAppInstance,
    5249 // Application::AddExit, FetchEnvironment;
    5350 #include YFM_YSLib_Core_YException // for ExtractAndTrace;
    54-#include YFM_YSLib_Core_YStorage // for FetchStaticRef;
    5551 #include YFM_Helper_Environment // for complete type Environment introduced by
    5652 // FetchEnvironment;
    5753
    @@ -108,16 +104,14 @@
    108104 # define YF_Helper_Initialization_UseFallbackConf_ true
    109105 #endif
    110106
    111-struct RootPathCache
    107+//! \note 初始化时使用平台路径分隔符结尾的目录路径字符串。
    108+struct RootPathCache final : public Deployment::RootPathBlock
    112109 {
    113- string PathString;
    114- IO::Path Path;
    115- IO::Path Parent;
    116-
    117- // XXX: Similar to %FetchConfPaths as of the concurrent execution.
    110+ // XXX: Similar to the static object initialization in %LoadNPLA1FileVec as
    111+ // of the concurrent execution.
    118112 //! \since build 957
    119113 RootPathCache(string::allocator_type a)
    120- : PathString([&]{
    114+ : RootPathBlock([&]{
    121115 #if YCL_Win32
    122116 IO::Path image(platform::ucast(
    123117 platform_ex::FetchModuleFileName({}, a).data()), a);
    @@ -128,7 +122,7 @@
    128122
    129123 const auto& dir(image.Verify());
    130124
    131- if(!dir.empty() && dir.back() == FetchSeparator<char16_t>())
    125+ if(!dir.empty() && dir.back() == IO::FetchSeparator<char16_t>())
    132126 return dir.GetMBCS();
    133127 }
    134128 #elif YCL_Android
    @@ -167,22 +161,14 @@
    167161 return dir;
    168162 }
    169163 #else
    170- // XXX: Trimming is necessary, because it is unspecified to have
    171- // trailing slashes with %platform::ugetcwd as POSIX.1 2004.
    172- auto root_path(ystdex::rtrim(FetchCurrentWorkingDirectory<char>(
    173- IO::MaxPathLength, a), IO::FetchSeparator<char>()));
    174-
    175- YAssert(platform::EndsWithNonSeperator(root_path),
    176- "Invalid argument found.");
    177- root_path += IO::FetchSeparator<char>();
    178- return root_path;
    164+ return FetchCurrentWorkingDirectoryPath(a);
    179165 // TODO: Add similar implemnetation for BSD family OS, etc.
    180166 #endif
    181167 throw GeneralEvent("Failed finding working root path.");
    182- }()), Path(PathString), Parent(Path / u"..")
    168+ }())
    183169 {
    184170 YTraceDe(Informative, "Initialized root directory path '%s'.",
    185- PathString.c_str());
    171+ GetPathString().c_str());
    186172 }
    187173 };
    188174
    @@ -203,6 +189,10 @@
    203189 return cache;
    204190 }
    205191
    192+//! \since build 982
    193+YB_ATTR_nodiscard YB_PURE inline PDefH(const string&, FetchRootPathString, )
    194+ ImplRet(FetchRootPathCache().GetPathString())
    195+
    206196 #if YF_Helper_Initialization_UseFallbackConf_
    207197 // XXX: Currently all platforms using fallback configurations have the same
    208198 // image path and root path.
    @@ -213,30 +203,6 @@
    213203 }
    214204 #endif
    215205
    216-YB_ATTR_nodiscard YB_PURE bool
    217-CheckLocalFHSLayoutImpl(const IO::Path& prefix, IO::Path bin)
    218-{
    219- if(bin != prefix)
    220- {
    221- const IO::Path
    222- paths[]{prefix, std::move(bin), prefix / u"lib", prefix / u"share"};
    223-
    224- return IO::VerifyDirectories(paths);
    225- }
    226- return {};
    227-}
    228-
    229-YB_ATTR_nodiscard YB_PURE bool
    230-CheckLocalFHSLayoutWithCache(const RootPathCache& cache)
    231-{
    232-# if true
    233- // XXX: This is more efficient.
    234- return CheckLocalFHSLayoutImpl(cache.Parent, cache.Path);
    235-# else
    236- return CheckLocalFHSLayout(cache.PathString);
    237-# endif
    238-}
    239-
    240206 YB_ATTR_nodiscard YB_PURE const string&
    241207 FetchPreferredConfPath()
    242208 {
    @@ -244,12 +210,13 @@
    244210 static string conf_path([]() -> string{
    245211 auto& cache(FetchImagePathCache());
    246212
    247- if(CheckLocalFHSLayoutWithCache(cache))
    213+ if(cache.HasLocalFHSLayout())
    248214 {
    249215 YTraceDe(Informative, "FHS layout is detected, using"
    250216 " '../var/YSLib/' relative to the program image path as the"
    251217 " preferred configuration path.");
    252- return (cache.Parent / u"var" / u"YSLib").GetString().GetMBCS();
    218+ return
    219+ (cache.GetParent() / u"var" / u"YSLib").GetString().GetMBCS();
    253220 }
    254221 YTraceDe(Informative, "FHS layout is not detected, using the root path"
    255222 " as the preferred configuration path.");
    @@ -305,16 +272,6 @@
    305272 #endif
    306273
    307274 #if !CHRLib_NoDynamic_Mapping
    308-//! \since build 861
    309-MappedFile
    310-LoadMappedModule(const std::string& path)
    311-{
    312- TryRet(MappedFile(path))
    313- CatchExpr(..., std::throw_with_nested(
    314- GeneralEvent("Loading module '" + path + "' failed.")))
    315- YAssert(false, "Unreachable control found.");
    316-}
    317-
    318275 # if YCL_Win32
    319276 //! \since build 552
    320277 const unsigned short* p_dbcs_off_936;
    @@ -338,7 +295,7 @@
    338295 mapping_name.c_str());
    339296 try
    340297 {
    341- mapped = LoadMappedModule(mapping_name);
    298+ mapped = IO::LoadMappedModule(mapping_name);
    342299 if(mapped.GetSize() != 0)
    343300 CHRLib::cp113 = mapped.GetPtr();
    344301 else
    @@ -391,13 +348,6 @@
    391348 };
    392349 #endif
    393350
    394-//! \since build 721
    395-inline void
    396-WriteNPLA1Stream(std::ostream& os, NPL::Configuration&& conf)
    397-{
    398- ystdex::write_literal(os, Text::BOM_UTF_8) << std::move(conf);
    399-}
    400-
    401351 //! \since build 971
    402352 //!@{
    403353 YB_ATTR_nodiscard ValueNode
    @@ -446,9 +396,9 @@
    446396 ystdex::swap_guard<int, void, decltype(errno)&> gd(errno, 0);
    447397
    448398 // XXX: Failed on race condition detected.
    449- if(UniqueLockedOutputFileStream uofs{path, std::ios_base::out
    450- | std::ios_base::trunc | platform::ios_noreplace})
    451- WriteNPLA1Stream(uofs, Nonnull(creator)(a));
    399+ if(UniqueLockedOutputFileStream uofs{path,
    400+ std::ios_base::out | std::ios_base::trunc | platform::ios_noreplace})
    401+ WriteNPLA1StreamWithBOM(uofs, Nonnull(creator)(a));
    452402 else
    453403 {
    454404 int err(errno);
    @@ -462,10 +412,16 @@
    462412 YTraceDe(Debug, "Created configuration.");
    463413 return LoadNPLA1FileDirect(disp, path, a, show_info);
    464414 }
    415+//!@}
    465416
    466-YB_ATTR_nodiscard YB_NONNULL(1) ValueNode
    467-LoadNPLA1MemoryFallback(ValueNodeCreator creator, ValueNode::allocator_type a)
    417+//! \since build 982
    418+YB_ATTR_nodiscard YB_NONNULL(2) ValueNode
    419+LoadNPLA1MemoryFallback(ValueNode&& res, ValueNodeCreator creator,
    420+ ValueNode::allocator_type a)
    468421 {
    422+ if(res)
    423+ return std::move(res);
    424+
    469425 YTraceDe(Notice, "Trying fallback in memory...");
    470426
    471427 std::stringstream ss;
    @@ -473,7 +429,6 @@
    473429 ss << Nonnull(creator)(a);
    474430 return TryReadRawNPLStream(ss, a);
    475431 }
    476-//!@}
    477432
    478433 //! \since build 899
    479434 //!@{
    @@ -488,9 +443,9 @@
    488443 YB_ATTR_nodiscard YB_PURE VecRecordMap&
    489444 FetchNPLA1PathVecRecordRef()
    490445 {
    491- static VecRecordMap m(&FetchPMRResourceRef());
    446+ static VecRecordMap vr(&FetchPMRResourceRef());
    492447
    493- return m;
    448+ return vr;
    494449 }
    495450
    496451 inline YB_NONNULL(1) void
    @@ -499,13 +454,65 @@
    499454 FetchNPLA1PathVecRecordRef().emplace(disp, conf_path);
    500455 }
    501456
    502-//! \since build 971
    503-YB_ATTR_nodiscard YB_NONNULL(1, 3, 4) ValueNode
    504-LoadNPLA1FileVec(const char* disp, const vector<string>& conf_paths,
    505- const char* filename, ValueNodeCreator creator, ValueNode::allocator_type a,
    506- bool show_info)
    457+// XXX: Previously %LoadNPLA1MemoryFallback was used directly without the empty
    458+// check and the conditional expressions in %LoadNPLA1FileVec and
    459+// %LoadNPLA1File for the check were occasioanlly not the same: in
    460+// %LoadNPLA1FileVec no %std::move was used on the 2nd operand. This is actualy
    461+// a bit more efficient with x86_64 Linux G++ 13.1.1. However, consistency is
    462+// more important, and it is even more efficient.
    463+//! \since build 982
    464+YB_ATTR_nodiscard YB_NONNULL(1, 2, 3) ValueNode
    465+LoadNPLA1FileVec(const char* disp, const char* filename,
    466+ ValueNodeCreator creator, ValueNode::allocator_type a, bool show_info)
    507467 {
    508- auto res(TryInvoke([=]() -> ValueNode{
    468+ static const struct Init final
    469+ {
    470+ vector<string> Paths;
    471+
    472+ // XXX: This may be concurrently executed across multiple threads
    473+ // without %call_once. This is still assumed safe (free of race)
    474+ // because the result shall be the same in each thread, or when there
    475+ // are concurrent modifications on the environment variables, the
    476+ // synchronization should be done by the host environment.
    477+ Init()
    478+ : Paths([]() -> vector<string>{
    479+ vector<string> res{FetchPreferredConfPath()};
    480+ string var;
    481+
    482+ if(FetchEnvironmentVariable(var, "HOME") && !var.empty())
    483+ {
    484+ AddSuffix(var);
    485+ res.push_back(std::move(var));
    486+ var.clear();
    487+ }
    488+#if YCL_Win32
    489+ if(FetchEnvironmentVariable(var, "USERPROFILE") && !var.empty())
    490+ {
    491+ AddSuffix(var);
    492+ res.push_back(std::move(var));
    493+ var.clear();
    494+ }
    495+#endif
    496+ return res;
    497+ }())
    498+ {
    499+ YTraceDe(Informative,
    500+ "Initialized enumerated configuration root paths.");
    501+ }
    502+
    503+ private:
    504+ //! \since build 982
    505+ static inline void
    506+ AddSuffix(string& var)
    507+ {
    508+ var += FetchSeparator<char>();
    509+ var += ".YSLib";
    510+ var += FetchSeparator<char>();
    511+ }
    512+ } init;
    513+ const auto& conf_paths(init.Paths);
    514+
    515+ return LoadNPLA1MemoryFallback(TryInvoke([=]() -> ValueNode{
    509516 for(const auto& conf_path : conf_paths)
    510517 {
    511518 const auto e(conf_path + filename);
    @@ -541,63 +548,11 @@
    541548 }
    542549 }
    543550 return {};
    544- }));
    545-
    546- return res ? res : LoadNPLA1MemoryFallback(creator, a);
    547-}
    548-
    549-const vector<string>&
    550-FetchConfPaths()
    551-{
    552- static const struct Init final
    553- {
    554- vector<string> Paths;
    555-
    556- // XXX: This may be concurrently executed across multiple threads
    557- // without %call_once. This is still assumed safe (free of race)
    558- // because the result shall be the same in each thread, or when there
    559- // are concurrent modifications on the environment variables, the
    560- // synchronization should be done by the host environment.
    561- Init()
    562- : Paths([]() -> vector<string>{
    563- vector<string> res{FetchPreferredConfPath()};
    564- string var;
    565-
    566- if(FetchEnvironmentVariable(var, "HOME") && !var.empty())
    567- {
    568- AddPostfix(var);
    569- res.push_back(std::move(var));
    570- var.clear();
    571- }
    572-#if YCL_Win32
    573- if(FetchEnvironmentVariable(var, "USERPROFILE") && !var.empty())
    574- {
    575- AddPostfix(var);
    576- res.push_back(std::move(var));
    577- var.clear();
    578- }
    579-#endif
    580- return res;
    581- }())
    582- {
    583- YTraceDe(Informative,
    584- "Initialized enumerated configuration root paths.");
    585- }
    586-
    587- private:
    588- static inline void
    589- AddPostfix(string& var)
    590- {
    591- var += FetchSeparator<char>();
    592- var += ".YSLib";
    593- var += FetchSeparator<char>();
    594- }
    595- } init;
    596-
    597- return init.Paths;
    551+ }), creator, a);
    598552 }
    599553 #endif
    600554
    555+// XXX: Keeping this out-of-line can be a bit efficient.
    601556 YB_ATTR_nodiscard YB_PURE const string&
    602557 FetchConfPathForSave()
    603558 {
    @@ -662,53 +617,12 @@
    662617 }
    663618
    664619
    665-bool
    666-CheckLocalFHSLayout(const string& path_string)
    620+const Deployment::RootPathBlock&
    621+FetchRootPathBlock()
    667622 {
    668- IO::Path bin(path_string);
    669- const auto prefix(bin / u"..");
    670-
    671- return CheckLocalFHSLayoutImpl(prefix, std::move(bin));
    672-}
    673-
    674-const IO::Path&
    675-FetchLocalFHSRootPath()
    676-{
    677-#if true
    678- // XXX: This is more efficient.
    679- auto& cache(FetchRootPathCache());
    680-
    681- if(CheckLocalFHSLayoutWithCache(cache))
    682- return cache.Parent;
    683- return FetchStaticRef<const IO::Path>();
    684-#else
    685- static const auto path(GetLocalFHSRootPathOf(FetchRootPathString()));
    623+ static const RootPathCache cache(&FetchPMRResourceRef());
    686624
    687- return path;
    688-#endif
    689-}
    690-
    691-const string&
    692-FetchRootPathString()
    693-{
    694- return FetchRootPathCache().PathString;
    695-}
    696-
    697-IO::Path
    698-GetLocalFHSRootPathOf(const string& path_string)
    699-{
    700-#if true
    701- // XXX: This is more efficient.
    702- IO::Path bin(path_string);
    703- auto prefix(bin / u"..");
    704-
    705- if(CheckLocalFHSLayoutImpl(prefix, std::move(bin)))
    706- return prefix;
    707-#else
    708- if(CheckLocalFHSLayout(path_string))
    709- return IO::Path(path_string) / u"..";
    710-#endif
    711- return {};
    625+ return cache;
    712626 }
    713627
    714628
    @@ -716,14 +630,12 @@
    716630 LoadNPLA1File(const char* disp, const char* path, ValueNodeCreator creator,
    717631 ValueNode::allocator_type a, bool show_info)
    718632 {
    719- auto res(TryInvoke([=]() -> ValueNode{
    633+ return LoadNPLA1MemoryFallback(TryInvoke([=]() -> ValueNode{
    720634 if(ufexists(path))
    721635 return LoadNPLA1FileDirect(disp, path, a, show_info);
    722636 YTraceDe(Debug, "Path '%s' access failed.", path);
    723637 return LoadNPLA1FileCreate(disp, path, creator, a, show_info);
    724- }));
    725-
    726- return res ? std::move(res) : LoadNPLA1MemoryFallback(creator, a);
    638+ }), creator, a);
    727639 }
    728640
    729641 void
    @@ -761,24 +673,21 @@
    761673 });
    762674
    763675 #if YF_Helper_Initialization_UseFallbackConf_
    764- return LoadNPLA1FileVec(ConfFileDisp, FetchConfPaths(), "yconf.txt",
    765- creator, a, show_info);
    676+ return LoadNPLA1FileVec(ConfFileDisp, "yconf.txt", creator, a, show_info);
    766677 #else
    767678 return LoadNPLA1File(ConfFileDisp, (FetchPreferredConfPath() + "yconf.txt")
    768679 .c_str(), creator, a, show_info);
    769680 #endif
    770-#undef YF_Helper_Initialization_UseFallbackConf_
    771681 }
    772682
    773683 void
    774684 SaveConfiguration(const ValueNode& node)
    775685 {
    776- if(UniqueLockedOutputFileStream uofs{
    777- (FetchConfPathForSave() + "yconf.txt").c_str(),
    778- std::ios_base::out | std::ios_base::trunc})
    686+ if(UniqueLockedOutputFileStream uofs{(FetchConfPathForSave()
    687+ + "yconf.txt").c_str(), std::ios_base::out | std::ios_base::trunc})
    779688 {
    780689 YTraceDe(Debug, "Writing configuration...");
    781- WriteNPLA1Stream(uofs, ValueNode(node.GetContainer()));
    690+ WriteNPLA1StreamWithBOM(uofs, ValueNode(node.GetContainer()));
    782691 }
    783692 else
    784693 throw GeneralEvent("Invalid file found when writing configuration.");
    @@ -788,6 +697,7 @@
    788697 #undef YF_Helper_Initialization_DataDirectory_
    789698 #undef YF_Helper_Initialization_FontDirectory_
    790699 #undef YF_Helper_Initialization_FontFile_
    700+#undef YF_Helper_Initialization_UseFallbackConf_
    791701
    792702
    793703 void
    @@ -842,11 +752,9 @@
    842752 return FetchEnvironment().Root;
    843753 }
    844754
    845-Drawing::FontCache&
    755+FontCache&
    846756 FetchDefaultFontCache()
    847757 {
    848- using Drawing::FontCache;
    849-
    850758 return FetchDefaultResource<FontCache>([]{
    851759 return make_unique<FontCache>(+FontCache::DefaultGlyphCacheSize,
    852760 FetchAppInstance().get_allocator());
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/Helper/ShellHelper.cpp
    --- a/YFramework/source/Helper/ShellHelper.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/Helper/ShellHelper.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2010-2015, 2019-2022 FrankHB.
    2+ © 2010-2015, 2019-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file ShellHelper.cpp
    1212 \ingroup Helper
    1313 \brief Shell 助手模块。
    14-\version r636
    14+\version r642
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 278
    1717 \par 创建时间:
    1818 2010-04-04 13:42:15 +0800
    1919 \par 修改时间:
    20- 2022-04-30 21:53 +0800
    20+ 2023-12-23 16:40 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -39,7 +39,7 @@
    3939 DebugTimer::DebugTimer(string_view str)
    4040 : event_info((yunused(Nonnull(str.data())), str)), base_tick()
    4141 {
    42- YTraceDe(0xF0, "Start tick of [%s] :", event_info.c_str());
    42+ YTraceDe(0xF0, "Start tick of [%s]:", event_info.c_str());
    4343 base_tick = Timers::HighResolutionClock::now();
    4444 }
    4545 DebugTimer::~DebugTimer()
    @@ -68,12 +68,12 @@
    6868 namespace
    6969 {
    7070
    71-//! \since build 264
    72-inline void
    71+//! \since build 982
    72+YB_NONNULL(1, 4) inline void
    7373 snftime(char* buf, size_t n, const std::tm& tm,
    74- const char* format = DefaultTimeFormat)
    74+ const char* format = DefaultTimeFormat) ynothrow
    7575 {
    76- // FIXME: Correct behavior for time with BC date(i.e. tm_year < -1900).
    76+ // FIXME: Correct behavior for time with BC date (i.e. tm_year < -1900).
    7777 std::snprintf(buf, n, format, tm.tm_year + 1900,
    7878 tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
    7979 }
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/NPL/Configuration.cpp
    --- a/YFramework/source/NPL/Configuration.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/NPL/Configuration.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2012-2016, 2020-2022 FrankHB.
    2+ © 2012-2016, 2020-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Configuration.cpp
    1212 \ingroup NPL
    1313 \brief 配置设置。
    14-\version r1048
    14+\version r1063
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 334
    1717 \par 创建时间:
    1818 2012-08-27 15:15:06 +0800
    1919 \par 修改时间:
    20- 2022-09-23 02:20 +0800
    20+ 2023-12-20 20:32 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -28,11 +28,14 @@
    2828 #include "NPL/YModules.h"
    2929 #include YFM_NPL_Configuration // for ystdex::value_or, AccessPtr, string,
    3030 // ystdex::quote, YSLib::AsNode, Deliteralize, PrintNode,
    31-// LiteralizeEscapeNodeLiteral;
    31+// LiteralizeEscapeNodeLiteral, LoggedEvent, ystdex::sfmt, YSLib::Warning,
    32+// std::exception;
    3233 #include YFM_NPL_NPLA1Forms // for A1, Forms, RegisterStrict;
    3334 #include YFM_NPL_Dependency // for LoadGroundContext;
    3435 #include <ystdex/ios.hpp> // for ystdex::rethrow_badstate,
    3536 // std::ios_base::failbit;
    37+#include <ystdex/string.hpp> // for ystdex::write_literal;
    38+#include YFM_YSLib_Service_TextFile // for YSLib::Text::BOM_UTF_8;
    3639
    3740 namespace NPL
    3841 {
    @@ -87,7 +90,7 @@
    8790 auto&& node(TransformNode(tm));
    8891
    8992 node_con.insert(node.GetName().empty() ? YSLib::AsNode(
    90- node.get_allocator(), '$' + MakeIndex(node_con.size()),
    93+ node.get_allocator(), '$' + MakeIndex(node_con.size(), a),
    9194 std::move(node.Value)) : std::move(node));
    9295 });
    9396 return {std::allocator_arg, a, std::move(node_con), name};
    @@ -106,12 +109,12 @@
    106109 NodeLoader::LoadNode(const TermNode& tree) const
    107110 {
    108111 TryRet(TransformNode(tree))
    109- CatchThrow(bad_any_cast& e, LoggedEvent(YSLib::sfmt("Bad NPLA1 tree found:"
    110- " cast failed from [%s] to [%s] .", e.from(), e.to()), YSLib::Warning))
    112+ CatchThrow(bad_any_cast& e, LoggedEvent(ystdex::sfmt("Bad NPLA1 tree found:"
    113+ " cast failed from [%s] to [%s].", e.from(), e.to()), YSLib::Warning))
    111114 catch(std::exception& e)
    112115 {
    113- YTraceDe(YSLib::Err, "Bad NPLA1 tree found: [%s]%s",
    114- typeid(e).name(), e.what());
    116+ YTraceDe(YSLib::Err, "Bad NPLA1 tree found: [%s]%s", typeid(e).name(),
    117+ e.what());
    115118 throw;
    116119 }
    117120 }
    @@ -134,5 +137,11 @@
    134137 return is;
    135138 }
    136139
    140+void
    141+WriteNPLA1StreamWithBOM(std::ostream& os, NPL::Configuration&& conf)
    142+{
    143+ ystdex::write_literal(os, YSLib::Text::BOM_UTF_8) << std::move(conf);
    144+}
    145+
    137146 } // namespace NPL;
    138147
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/NPL/Dependency.cpp
    --- a/YFramework/source/NPL/Dependency.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/NPL/Dependency.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -11,13 +11,13 @@
    1111 /*! \file Dependency.cpp
    1212 \ingroup NPL
    1313 \brief 依赖管理。
    14-\version r9261
    14+\version r9269
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 623
    1717 \par 创建时间:
    1818 2015-08-09 22:14:45 +0800
    1919 \par 修改时间:
    20- 2023-11-24 08:45 +0800
    20+ 2024-02-14 00:05 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -2295,7 +2295,7 @@
    22952295 // NOTE: As %StringSplit in NPLA1Extended.cpp.
    22962296 string::size_type pos(0), orig(0);
    22972297
    2298- while((pos = x.find('?', pos)) != string::npos)
    2298+ while((pos = x.find(';', pos)) != string::npos)
    22992299 {
    23002300 p_vec->push_back(x.substr(orig, pos - orig));
    23012301 orig = ++pos;
    @@ -2345,7 +2345,7 @@
    23452345 throw NPLException(
    23462346 "Requirement '" + to_std_string(req) + "' is not registered.");
    23472347 });
    2348- RegisterUnary<Strict, const string>(m, "find-requirement-filename",
    2348+ RegisterUnary<Strict, const string>(m, "find-required-filename",
    23492349 // TODO: Blocked. Use C++14 lambda initializers to optimize the
    23502350 // implementation.
    23512351 // XXX: Not using binding to prevent overloading ambiguity.
    @@ -2429,7 +2429,7 @@
    24292429 // XXX: Thread-safety is not respected currently.
    24302430 A1::Perform(cs, R"NPL(
    24312431 $provide/let! (registered-requirement? register-requirement!
    2432- unregister-requirement! find-requirement-filename require)
    2432+ unregister-requirement! find-required-filename require)
    24332433 ((mods $as-environment (
    24342434 $import&! std.strings string-empty? ++ string->symbol;
    24352435
    @@ -2450,7 +2450,7 @@
    24502450 (($remote-eval% string-split std.strings) spec ";"),
    24512451 (
    24522452 $def! placeholder ($remote-eval% string->regex std.strings) "\?",
    2453- $defl! get-requirement-filename (&specs &req)
    2453+ $defl! get-required-filename (&specs &req)
    24542454 $if (null? specs)
    24552455 (raise-error (++ "No module for requirement '" req
    24562456 "' found."))
    @@ -2458,7 +2458,7 @@
    24582458 $let* ((spec first& specs) (path ($remote-eval% regex-replace
    24592459 std.strings) spec placeholder req))
    24602460 $if (($remote-eval% readable-file? std.io) path) path
    2461- (get-requirement-filename (rest& specs) req)
    2461+ (get-required-filename (rest& specs) req)
    24622462 )
    24632463 )
    24642464 )))
    @@ -2476,12 +2476,12 @@
    24762476 $if (string-empty? req) (() requirement-error)
    24772477 ($if (bound-name? req) (set-value! req ()) (raise-error
    24782478 (++ "Requirement '" req "' is not registered."))),
    2479- $defl/e! &find-requirement-filename mods (&req)
    2480- get-requirement-filename
    2479+ $defl/e! &find-required-filename mods (&req)
    2480+ get-required-filename
    24812481 (($remote-eval% force std.promises) prom_pathspecs) req;
    24822482 $defl/e%! require mods (&req .&opt)
    24832483 $if (registered-requirement? req) (get-cell% (forward! req))
    2484- ($let*% ((filename find-requirement-filename req)
    2484+ ($let*% ((filename find-required-filename req)
    24852485 (env register-requirement! req) (&res get-cell% (forward! req)))
    24862486 $sequence
    24872487 ($unless (null? opt)
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/NPL/SXML.cpp
    --- a/YFramework/source/NPL/SXML.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/NPL/SXML.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2015-2017, 2019-2020, 2022 FrankHB.
    2+ © 2015-2017, 2019-2020, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file SXML.cpp
    1212 \ingroup NPL
    1313 \brief NPL SXML 实现。
    14-\version r4735
    14+\version r4737
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 936
    1717 \par 创建时间:
    1818 2022-01-20 17:41:15 +0800
    1919 \par 修改时间:
    20- 2022-06-14 18:34 +0800
    20+ 2023-12-23 16:36 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -69,7 +69,7 @@
    6969 {
    7070 if(term)
    7171 {
    72- string res(ConvertStringNode(term));
    72+ auto res(ConvertStringNode(term));
    7373
    7474 if(res.empty())
    7575 {
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YCLib/Keys.cpp
    --- a/YFramework/source/YCLib/Keys.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YCLib/Keys.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2016, 2018, 2021 FrankHB.
    2+ © 2009-2016, 2018, 2021, 2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Keys.cpp
    1212 \ingroup YCLib
    1313 \brief 平台相关的基本按键输入定义。
    14-\version r1279
    14+\version r1283
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 313
    1717 \par 创建时间:
    1818 2012-06-01 14:32:37 +0800
    1919 \par 修改时间:
    20- 2021-12-29 01:49 +0800
    20+ 2024-02-26 05:47 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -26,10 +26,9 @@
    2626
    2727
    2828 #include "YCLib/YModules.h"
    29-#include YFM_YCLib_Keys // for octet;
    29+#include YFM_YCLib_Keys // for size, octet;
    3030 #include YFM_YCLib_Debug
    3131 #include YFM_YCLib_NativeAPI
    32-#include YFM_YCLib_Container // for size;
    3332
    3433 namespace platform
    3534 {
    @@ -115,7 +114,7 @@
    115114 Editing | NonKeyboard // Extended tertiary key.
    116115 };
    117116 #elif YCL_Win32
    118-// See http://msdn.microsoft.com/library/windows/desktop/dd375731%28v=vs.85%29.aspx.
    117+// See https://msdn.microsoft.com/library/windows/desktop/dd375731.aspx.
    119118 yconstexpr const Category KeyCategoryTable[KeyBitsetWidth]{
    120119 None, // 0 is not assigned.
    121120 Editing | NonKeyboard, // VK_LBUTTON is a mouse key.
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YCLib/XCB.cpp
    --- a/YFramework/source/YCLib/XCB.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YCLib/XCB.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2014-2016, 2018, 2020, 2023 FrankHB.
    2+ © 2014-2016, 2018, 2020, 2023-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -12,13 +12,13 @@
    1212 \ingroup YCLib
    1313 \ingroup YCLibLimitedPlatforms
    1414 \brief XCB GUI 接口。
    15-\version r614
    15+\version r622
    1616 \author FrankHB <frankhb1989@gmail.com>
    1717 \since build 427
    1818 \par 创建时间:
    1919 2014-12-14 14:14:31 +0800
    2020 \par 修改时间:
    21- 2023-05-07 04:16 +0800
    21+ 2024-02-25 23:10 +0800
    2222 \par 文本编码:
    2323 UTF-8
    2424 \par 模块名称:
    @@ -27,12 +27,12 @@
    2727
    2828
    2929 #include "YCLib/YModules.h"
    30-#include YFM_YCLib_Platform // for YSLib::Drawing, YSLib::RecordLevel,
    31-// YSLib::Err, YSLib::Informative, platform::Deref, platform::Nonnull,
    32-// ordered_linked_map, YTraceDe;
    30+#include YFM_YCLib_Platform // for platform::Nonnull;
    3331 #if YF_Use_XCB
    32+# include YFM_YCLib_XCB // for YSLib::Drawing, YSLib::RecordLevel, YSLib::Err,
    33+// YSLib::Informative, platform::Deref, ordered_linked_map, YTraceDe,
    34+// YSLib::FilterExceptions;
    3435 # include <ystdex/array.hpp> // for ystdex::cast_array;
    35-# include YFM_YCLib_XCB // for YSLib::FilterExceptions;
    3636 # include YFM_YCLib_Mutex // for platform::Concurrency, platform::Threading;
    3737 # include <xcb/xcb.h> // for ::uint32_t, ::uint8_t;
    3838 # include <ystdex/addressof.hpp> // for ystdex::pvoid;
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YSLib/Core/YApplication.cpp
    --- a/YFramework/source/YSLib/Core/YApplication.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YSLib/Core/YApplication.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2016, 2020-2022 FrankHB.
    2+ © 2009-2016, 2020-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YApplication.cpp
    1212 \ingroup Core
    1313 \brief 系统资源和应用程序实例抽象。
    14-\version r1757
    14+\version r1776
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since 早于 build 132
    1717 \par 创建时间:
    1818 2009-12-27 17:12:36 +0800
    1919 \par 修改时间:
    20- 2022-09-03 21:39 +0800
    20+ 2023-12-23 16:41 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -43,16 +43,19 @@
    4343 {
    4444 // See $2020-04 @ %Documentation::Workflow.
    4545 qMain.clear();
    46- if(YB_UNLIKELY(hShell))
    46+ if(!hShell)
    47+ {
    48+ hShell = {};
    49+ YTraceDe(Notice, "Deinitialization entered with %zu handler(s) to be"
    50+ " called.", on_exit.size());
    51+ // NOTE: This is needed because the standard containers (and adaptors)
    52+ // guarantee nothing about destruction order of contained elements.
    53+ while(!on_exit.empty())
    54+ on_exit.pop();
    55+ }
    56+ else
    4757 YTraceDe(Warning, "Active shell found with count %ld.",
    4858 hShell.use_count());
    49- hShell = {};
    50- YTraceDe(Notice, "Deinitialization entered with %zu handler(s) to be"
    51- " called.", on_exit.size());
    52- // NOTE: This is needed because the standard containers (and adaptors)
    53- // guarantee nothing about destruction order of contained elements.
    54- while(!on_exit.empty())
    55- on_exit.pop();
    5659 }
    5760
    5861 void
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YSLib/Core/YObject.cpp
    --- a/YFramework/source/YSLib/Core/YObject.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YSLib/Core/YObject.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2013, 2015-2017, 2019-2022 FrankHB.
    2+ © 2009-2013, 2015-2017, 2019-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YObject.cpp
    1212 \ingroup Core
    1313 \brief 平台无关的基础对象。
    14-\version r923
    14+\version r927
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since 早于 build 132
    1717 \par 创建时间:
    1818 2009-11-16 20:06:58 +0800
    1919 \par 修改时间:
    20- 2022-11-28 19:53 +0800
    20+ 2023-12-20 20:31 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -75,9 +75,9 @@
    7575 {
    7676 const auto p_holder(content.get_holder());
    7777
    78- if(const auto q = x.content.get_holder())
    79- return p_holder == q || (p_holder && p_holder->type() == q->type()
    80- && HolderEquals(*p_holder, q->get()));
    78+ if(const auto q_holder = x.content.get_holder())
    79+ return p_holder == q_holder || (p_holder && p_holder->type()
    80+ == q_holder->type() && HolderEquals(*p_holder, q_holder->get()));
    8181 return !p_holder;
    8282 }
    8383
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YSLib/Service/FileSystem.cpp
    --- a/YFramework/source/YSLib/Service/FileSystem.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YSLib/Service/FileSystem.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2010-2016, 2019-2023 FrankHB.
    2+ © 2010-2016, 2019-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file FileSystem.cpp
    1212 \ingroup Service
    1313 \brief 平台中立的文件系统抽象。
    14-\version r2436
    14+\version r2502
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since 早于 build 132
    1717 \par 创建时间:
    1818 2010-03-28 00:36:30 +0800
    1919 \par 修改时间:
    20- 2023-10-02 16:48 +0800
    20+ 2024-02-25 02:41 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -28,11 +28,13 @@
    2828 #include "YSLib/Service/YModules.h"
    2929 #include YFM_YSLib_Service_FileSystem // for FetchCurrentWorkingDirectory,
    3030 // IsAbsolute, DirectorySession, umkdir, MakeMBCS, FetchSeparator,
    31-// use_openmode_t, IsDirectory;
    31+// use_openmode_t, IsDirectory, IO::EndsWithNonSeperator;
    3232 #include <ios> // for std::ios_base::in, std::ios_base::binary;
    3333 #include <cerrno> // for errno, EEXIST;
    3434 #include <ystdex/exception.h> // for std::system_error, ystdex::throw_error;
    3535 #include YFM_YSLib_Service_File // for OpenFile;
    36+#include YFM_YSLib_Core_YStorage // for FetchStaticRef;
    37+#include <ystdex/string.hpp> // for ystdex::rtrim;
    3638
    3739 namespace YSLib
    3840 {
    @@ -276,6 +278,79 @@
    276278
    277279 } // unnamed namespace;
    278280
    281+bool
    282+CheckLocalFHSLayout(const IO::Path& pfx, IO::Path bin)
    283+{
    284+ if(bin != pfx)
    285+ {
    286+ const IO::Path
    287+ paths[]{pfx, std::move(bin), pfx / u"lib", pfx / u"share"};
    288+
    289+ return IO::VerifyDirectories(paths);
    290+ }
    291+ return {};
    292+}
    293+bool
    294+CheckLocalFHSLayout(const string& path)
    295+{
    296+ IO::Path bin(path, path.get_allocator());
    297+ const auto pfx(bin / u"..");
    298+
    299+ return CheckLocalFHSLayout(pfx, std::move(bin));
    300+}
    301+
    302+IO::Path
    303+GetLocalFHSRootPathOf(const string& path)
    304+{
    305+#if true
    306+ // XXX: This is more efficient.
    307+ IO::Path bin(path, path.get_allocator());
    308+ auto prefix(bin / u"..");
    309+
    310+ if(Deployment::CheckLocalFHSLayout(prefix, std::move(bin)))
    311+ return prefix;
    312+#else
    313+ if(Deployment::CheckLocalFHSLayout(path))
    314+ return IO::Path(path, path.get_allocator()) / u"..";
    315+#endif
    316+ return {};
    317+}
    318+
    319+
    320+const IO::Path&
    321+RootPathBlock::GetSavedLocalFHSRootPath() const
    322+{
    323+ // XXX: This is more efficient than
    324+ // 'Deployment::GetLocalFHSRootPathOf(saved)' cached in static storage
    325+ // (with some default allocator).
    326+ return HasLocalFHSLayout() ? parent : FetchStaticRef<const IO::Path>();
    327+}
    328+
    329+bool
    330+RootPathBlock::HasLocalFHSLayout() const
    331+{
    332+# if true
    333+ // XXX: This is more efficient.
    334+ return CheckLocalFHSLayout(parent, current);
    335+# else
    336+ return CheckLocalFHSLayout(saved);
    337+# endif
    338+}
    339+
    340+string
    341+RootPathBlock::FetchCurrentWorkingDirectoryPath(string::allocator_type a)
    342+{
    343+ // XXX: Trimming is necessary, because it is unspecified to have trailing
    344+ // slashes with %platform::ugetcwd as POSIX.1 2004.
    345+ auto res(ystdex::rtrim(FetchCurrentWorkingDirectory<char>(
    346+ IO::MaxPathLength, a), IO::FetchSeparator<char>()));
    347+
    348+ YAssert(IO::EndsWithNonSeperator(res), "Invalid argument found.");
    349+ res += IO::FetchSeparator<char>();
    350+ return res;
    351+}
    352+
    353+
    279354 void
    280355 InstallFile(const char* dst, const char* src)
    281356 {
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YSLib/Service/ImageProcessing.cpp
    --- a/YFramework/source/YSLib/Service/ImageProcessing.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YSLib/Service/ImageProcessing.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2014-2015, 2021-2022 FrankHB.
    2+ © 2014-2015, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file ImageProcessing.cpp
    1212 \ingroup Service
    1313 \brief 图像处理。
    14-\version r287
    14+\version r290
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 554
    1717 \par 创建时间:
    1818 2014-11-16 16:37:27 +0800
    1919 \par 修改时间:
    20- 2022-04-30 21:54 +0800
    20+ 2023-12-23 16:19 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -27,6 +27,7 @@
    2727
    2828 #include "YSLib/UI/YModules.h"
    2929 #include YFM_YSLib_Service_ImageProcessing
    30+#include <ystdex/cache.hpp> // for ystdex::cache_lookup;
    3031
    3132 namespace YSLib
    3233 {
    @@ -63,7 +64,7 @@
    6364 YAssert(idx < bitmaps.size(), "Invalid index found.");
    6465
    6566 return ystdex::cache_lookup(cache, CacheKey(scale, idx), [&]{
    66- return make_shared<Image>(Zoom(bitmaps[idx], scale));
    67+ return YSLib::make_shared<Image>(Zoom(bitmaps[idx], scale));
    6768 });
    6869 }
    6970
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YSLib/Service/TextRenderer.cpp
    --- a/YFramework/source/YSLib/Service/TextRenderer.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YSLib/Service/TextRenderer.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2015, 2017, 2019, 2022 FrankHB.
    2+ © 2009-2015, 2017, 2019, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file TextRenderer.cpp
    1212 \ingroup Service
    1313 \brief 文本渲染。
    14-\version r2768
    14+\version r2770
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 275
    1717 \par 创建时间:
    1818 2009-11-13 00:06:05 +0800
    1919 \par 修改时间:
    20- 2022-04-30 21:55 +0800
    20+ 2023-12-23 16:25 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -31,8 +31,6 @@
    3131 #include YFM_YSLib_Service_TextLayout // for FetchLastLineBasePosition;
    3232 #include <ystdex/cwctype.h> // for ystdex::iswgraph;
    3333
    34-using namespace ystdex;
    35-
    3634 namespace YSLib
    3735 {
    3836
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YSLib/Service/YBlend.cpp
    --- a/YFramework/source/YSLib/Service/YBlend.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YSLib/Service/YBlend.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2015, 2022 FrankHB.
    2+ © 2015, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YBlend.cpp
    1212 \ingroup Service
    1313 \brief 平台无关的图像块操作。
    14-\version r59
    14+\version r61
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 584
    1717 \par 创建时间:
    1818 2015-03-17 06:19:55 +0800
    1919 \par 修改时间:
    20- 2022-04-30 21:56 +0800
    20+ 2023-12-23 16:24 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -28,8 +28,6 @@
    2828 #include "YSLib/Service/YModules.h"
    2929 #include YFM_YSLib_Service_YBlend
    3030
    31-using namespace ystdex;
    32-
    3331 namespace YSLib
    3432 {
    3533
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YSLib/Service/YDraw.cpp
    --- a/YFramework/source/YSLib/Service/YDraw.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YSLib/Service/YDraw.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2011-2016, 2019, 2022 FrankHB.
    2+ © 2011-2016, 2019, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YDraw.cpp
    1212 \ingroup Service
    1313 \brief 平台无关的二维图形光栅化。
    14-\version r1120
    14+\version r1134
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 219
    1717 \par 创建时间:
    1818 2011-06-16 19:45:33 +0800
    1919 \par 修改时间:
    20- 2022-04-30 21:56 +0800
    20+ 2023-12-23 16:22 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -93,12 +93,9 @@
    9393 PlotVLineSeg(dst, bounds, w, x1, y1, y2 + 1, c);
    9494 else
    9595 {
    96- /*
    97- 一般 Bresenham 算法:实现自
    98- http://cg.sjtu.edu.cn/lecture_site/chap2/mainframe212.htm 伪代码。
    99- */
    100- //起点 (x1, y1) 和终点 (x2, y2) 不同。
    101-
    96+ // NOTE: General Bresenham's algorithm: from
    97+ // http://cg.sjtu.edu.cn/lecture_site/chap2/mainframe212.htm. The
    98+ // points (x1, y1) and (x2, y2) shall be different.
    10299 const std::int8_t sx(FetchSign(x2 - x1)), sy(FetchSign(y2 - y1));
    103100 SDst dx(SDst(abs(x2 - x1))), dy(SDst(abs(y2 - y1)));
    104101 bool f(dy > dx);
    @@ -106,12 +103,11 @@
    106103 if(f)
    107104 std::swap(dx, dy);
    108105
    109- //初始化误差项以补偿非零截断。
    106+ // NOTE: Initialize error term to make up the non-zero trucations.
    110107 // XXX: Conversion to 'SPos' might be implementation-defined.
    111108 const SPos dx2(SPos(dx << 1)), dy2(SPos(dy << 1));
    112109 SPos e(dy2 - SPos(dx));
    113110
    114- //主循环。
    115111 while(dx-- != 0)
    116112 {
    117113 PlotPixel(dst, bounds, w, x1, y1, c);
    @@ -166,8 +162,8 @@
    166162 YAssert(bounds.IsUnstrictlyEmpty() || Rect(g.GetSize()).Contains(bounds),
    167163 "The boundary is out of the buffer.");
    168164 if(r != 0)
    169- // Bresenham circle algorithm implementation.
    170- // See http://willperone.net/Code/codecircle.php.
    165+ // NOTE: Bresenham's circle algorithm implementation. See
    166+ // http://willperone.net/Code/codecircle.php.
    171167 // XXX: Conversion to 'SPos' might be implementation-defined.
    172168 for(SPos x(0), y((SPos(r))), p(SPos(3 - 2 * r)); y >= x;
    173169 p += p < 0 ? (4 * x++ + 6) : (4 * (x++ - y--) + 10))
    @@ -204,10 +200,9 @@
    204200 {
    205201 PlotCircle([](const Graphics& g, const Rect& bounds, SPos x, SPos y,
    206202 SPos dx, SPos dy, Color c){
    207- using namespace std;
    208- using namespace placeholders;
    209- const auto plot(bind(PlotHLineSeg, g.GetBufferPtr(), std::cref(bounds),
    210- g.GetWidth(), _1, _2, _3, c));
    203+ using namespace std::placeholders;
    204+ const auto plot(std::bind(PlotHLineSeg, g.GetBufferPtr(),
    205+ std::cref(bounds), g.GetWidth(), _1, _2, _3, c));
    211206
    212207 plot(y + dy, x - dx, x + dx + 1),
    213208 plot(y - dy, x - dx, x + dx + 1),
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YSLib/UI/Loader.cpp
    --- a/YFramework/source/YSLib/UI/Loader.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YSLib/UI/Loader.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2013-2016, 2018-2022 FrankHB.
    2+ © 2013-2016, 2018-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Loader.cpp
    1212 \ingroup UI
    1313 \brief 动态 GUI 加载。
    14-\version r395
    14+\version r400
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 433
    1717 \par 创建时间:
    1818 2013-08-01 20:39:49 +0800
    1919 \par 修改时间:
    20- 2022-09-22 23:36 +0800
    20+ 2023-12-23 16:47 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -27,7 +27,8 @@
    2727
    2828 #include "YSLib/UI/YModules.h"
    2929 #include YFM_YSLib_UI_Loader // for to_std_string, istringtream,
    30-// std::allocator_arg, shared_ptr;
    30+// std::invalid_argument, to_string, std::allocator_arg, Deref, Access,
    31+// shared_ptr;
    3132 #include <sstream> // for complete istringtream;
    3233 #include <limits> // for std::numeric_limits;
    3334
    @@ -104,7 +105,7 @@
    104105 {
    105106 if(unique_ptr<IWidget> p_new_widget{DetectWidgetNode(node)})
    106107 {
    107- ValueNode res(AsNode(node.GetName()));
    108+ auto res(YSLib::AsNode(node.GetName()));
    108109 const auto& key(AccessChild<string>(node, "$type"));
    109110 const bool ins(Insert.Contains(key));
    110111 const bool insz(InsertZOrdered.Contains(key));
    @@ -134,7 +135,7 @@
    134135 r(std::stoul(to_std_string(*p_z)));
    135136
    136137 if(r <= std::numeric_limits<ZOrder>::max())
    137- z = r;
    138+ z = ZOrder(r);
    138139 }
    139140 CatchIgnore(std::invalid_argument&)
    140141 if(node_con.insert(std::move(child)).second)
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YFramework/source/YSLib/UI/YUIContainer.cpp
    --- a/YFramework/source/YSLib/UI/YUIContainer.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YFramework/source/YSLib/UI/YUIContainer.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2011-2016, 2021-2022 FrankHB.
    2+ © 2011-2016, 2021-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YUIContainer.cpp
    1212 \ingroup UI
    1313 \brief 样式无关的 GUI 容器。
    14-\version r1947
    14+\version r1956
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 188
    1717 \par 创建时间:
    1818 2011-01-22 08:03:49 +0800
    1919 \par 修改时间:
    20- 2022-11-28 18:59 +0800
    20+ 2023-12-23 16:14 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -26,8 +26,10 @@
    2626
    2727
    2828 #include "YSLib/UI/YModules.h"
    29-#include YFM_YSLib_UI_YDesktop
    29+#include YFM_YSLib_UI_YDesktop // for YSLib::make_observer;
    30+#include <ystdex/ref.hpp> // for ystdex::ref;
    3031 #include <ystdex/bind.hpp> // for ystdex::bind1;
    32+#include <algorithm> // for std::count_if, std::find_if;
    3133
    3234 using namespace ystdex;
    3335
    @@ -65,7 +67,7 @@
    6567 vector<pair<observer_ptr<const IWidget>, Point>> lst;
    6668 Point pt;
    6769
    68- for(auto p_wgt(make_observer(&wgt)); p_wgt;
    70+ for(auto p_wgt(YSLib::make_observer(&wgt)); p_wgt;
    6971 p_wgt = FetchContainerPtr(*p_wgt))
    7072 {
    7173 lst.emplace_back(p_wgt, pt);
    @@ -102,7 +104,7 @@
    102104 {
    103105 Point pt;
    104106
    105- for(auto p_wgt(make_observer(&wgt)); p_wgt;
    107+ for(auto p_wgt(YSLib::make_observer(&wgt)); p_wgt;
    106108 p_wgt = FetchContainerPtr(*p_wgt))
    107109 {
    108110 const auto
    @@ -186,7 +188,7 @@
    186188 {
    187189 auto t(vWidgets.size());
    188190
    189- erase_all_if(vWidgets, bind1(is_equal(), std::ref(wgt)));
    191+ erase_all_if(vWidgets, ystdex::bind1(is_equal(), std::ref(wgt)));
    190192 t -= vWidgets.size();
    191193 YAssert(t <= 1, "Duplicate widget references found.");
    192194 return t != 0;
    @@ -196,14 +198,14 @@
    196198 MLinearUIContainer::Contains(IWidget& wgt) const
    197199 {
    198200 return std::count_if(vWidgets.cbegin(), vWidgets.cend(),
    199- bind1(is_equal(), std::ref(wgt))) != 0;
    201+ ystdex::bind1(is_equal(), std::ref(wgt))) != 0;
    200202 }
    201203
    202204 size_t
    203205 MLinearUIContainer::Find(IWidget& wgt) const
    204206 {
    205207 return size_t(std::find_if(vWidgets.cbegin(), vWidgets.cend(),
    206- bind1(is_equal(), std::ref(wgt))) - vWidgets.cbegin());
    208+ ystdex::bind1(is_equal(), std::ref(wgt))) - vWidgets.cbegin());
    207209 }
    208210
    209211 MLinearUIContainer::iterator
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YSTest/DS/Makefile
    --- a/YSTest/DS/Makefile Wed Dec 20 00:28:16 2023 +0800
    +++ b/YSTest/DS/Makefile Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 #
    2-# (C) 2009-2021 FrankHB.
    2+# (C) 2009-2024 FrankHB.
    33 #
    44 # This file is part of the YSLib project, and may only be used,
    55 # modified, and distributed under the terms of the YSLib project
    @@ -8,9 +8,9 @@
    88 # understand and accept it fully.
    99 #
    1010 # DS Makefile for YSTest by FrankHB
    11-# Version = r1227
    11+# Version = r1229
    1212 # Created = 2009-11-12 21:26:30 +0800
    13-# Updated = 2021-10-23 17:43 +0800
    13+# Updated = 2024-02-27 00:24 +0800
    1414 # Encoding = ANSI
    1515
    1616
    @@ -46,7 +46,7 @@
    4646
    4747 TITLE := $(PROJNAME)
    4848 SUBTITLE1 := FrankHB
    49-SUBTITLE2 := 2009-2020
    49+SUBTITLE2 := 2009-2024
    5050 ICON := -b $(CURDIR)/data/logo.bmp
    5151
    5252 ARM7ELF := $(BUILDDIR)/../../$(TARGET)_ARM7/$(CONF)/$(TARGET)_ARM7.arm7.elf
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YSTest/source/About.cpp
    --- a/YSTest/source/About.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YSTest/source/About.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2012-2016, 2019, 2021-2023 FrankHB.
    2+ © 2012-2016, 2019, 2021-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file About.cpp
    1212 \ingroup YReader
    1313 \brief 关于界面。
    14-\version r291
    14+\version r293
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 390
    1717 \par 创建时间:
    1818 2013-03-20 21:06:35 +0800
    1919 \par 修改时间:
    20- 2023-04-05 04:18 +0800
    20+ 2024-02-27 00:26 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -80,7 +80,7 @@
    8080 + String(p, lblVersion.Text.get_allocator()),
    8181 lblVersion.ForeColor = ColorSpace::Green,
    8282 lblCopyright.Background = nullptr,
    83- lblCopyright.Text = String("(C)2009-2023 by ") + G_COMP_NAME,
    83+ lblCopyright.Text = String("(C)2009-2024 by ") + G_COMP_NAME,
    8484 lblCopyright.ForeColor = ColorSpace::Maroon,
    8585 btnSysInfo.Text = u"系统信息",
    8686 btnExit.Text = u"退出",
    diff -r 986ffb3ca9d6 -r ad10f75265b2 YSTest/source/Main.cpp
    --- a/YSTest/source/Main.cpp Wed Dec 20 00:28:16 2023 +0800
    +++ b/YSTest/source/Main.cpp Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2016, 2018, 2020, 2022 FrankHB.
    2+ © 2009-2016, 2018, 2020, 2022-2023 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file Main.cpp
    1212 \ingroup DS
    1313 \brief 主源文件。
    14-\version r1986
    14+\version r1990
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 1
    1717 \par 创建时间:
    1818 2009-11-12 21:26:30 +0800
    1919 \par 修改时间:
    20- 2022-11-28 14:56 +0800
    20+ 2023-12-20 01:22 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -131,8 +131,8 @@
    131131
    132132
    133133 //! 非 YSLib 声明的平台相关函数。
    134-//@{
    135-//@}
    134+//!@{
    135+//!@}
    136136
    137137 } // namespace YSLib;
    138138
    @@ -192,7 +192,7 @@
    192192 }
    193193 YTraceDe(Debug, "Splash completed.");
    194194 Execute(app, make_shared<YReader::ShlExplorer>());
    195- //释放 Shell (必要,保证释放 Shell 且避免资源泄漏)。
    195+ //释放 Shell(必要,保证释放 Shell 且避免资源泄漏)。
    196196 YReader::Cleanup();
    197197 }
    198198
    diff -r 986ffb3ca9d6 -r ad10f75265b2 doc/ChangeLog.V0.9.txt
    --- a/doc/ChangeLog.V0.9.txt Wed Dec 20 00:28:16 2023 +0800
    +++ b/doc/ChangeLog.V0.9.txt Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2020-2023 FrankHB.
    2+ © 2020-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file ChangeLog.V0.9.txt
    1212 \ingroup Documentation
    1313 \brief 版本更新历史记录 - V0.9 。
    14-\version r20217
    14+\version r20486
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 900
    1717 \par 创建时间:
    1818 2020-10-12 17:19:23 +0800
    1919 \par 修改时间:
    20- 2023-12-20 00:27 +0800
    20+ 2024-02-27 00:28 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -32,6 +32,275 @@
    3232
    3333 $now
    3434 (
    35+ / %YBase $=
    36+ (
    37+ / %YStandardEx $=
    38+ (
    39+ + $re_add(b973) DD "'\ingroup hashers'" @ "Doxygen comment"
    40+ @ ("class template specialization %std::hash for %fixed_point \
    41+ instances" @ %Rational, "class template specialization \
    42+ %std::hash for %type_id" @ %TypeIndex),
    43+ / $re_add(b981) DLDI "all '::value' not forming an operand to an \
    44+ operator and not after a qualified type-id" @ "non-type \
    45+ argument of some metafunctions" -> '{}'
    46+ @ ("function template %is_zero#1", ("constructor#(3, 4, 5, 6)",
    47+ "all 2 function template %operator _type")
    48+ @ "class template %fixed_point",
    49+ $impl "macros %(YB_Impl_Rational_fp_TmplHead_2_l, \
    50+ YB_Impl_Rational_fp_TmplHead_2_r)") @ %Rational,
    51+ / $re_add(b961) DLDI "all %_tState" @ %FunctionAdaptor => "%_tCond"
    52+ $effective @ "%one_shot",
    53+ // To be consistent with %state_guard, as the change made in \
    54+ %ScopeGuard.
    55+ / $re_add(b980) DLDI "simplified condition"
    56+ @ "static function template %are_equal" @ "struct %always_equal"
    57+ @ %Examiner !^ '&&',
    58+ / %Functional $=
    59+ (
    60+ + "conditionally defined macro %__cpp_lib_not_fn",
    61+ + "class template %not_fn_t";
    62+ + "function template %not_fn"
    63+ ),
    64+ * DD "wrong '\param' command" @ "Doxygen comment"
    65+ @ "function tempalte %construct_default_in"
    66+ @ %Placement $since b716,
    67+ / DLDI "member function %details::list_node_base::swap" @ %NodeBase
    68+ !^ "nested '=' expressions"
    69+ ),
    70+ * "missing inclusion %YBase.YStandardEx.CStandardDefinition"
    71+ @ %YTest.Timing $since b933
    72+ // For %ystdex::size_t.
    73+ $= (/ $impl "header inclusion %YBase.YDefinition"
    74+ -> "%YBase.YStandardEx.CStandardDefinition")
    75+ ),
    76+ / DLDI "all parameter 'hShl'" => 'h' $effective @ ("function %Activate"
    77+ @ %YSLib.Core.YApplication, @ "functions %(IsNowShell, NowShellTo, \
    78+ SetShellTo)" @ %Helper.ShellHelper) @ %YFramework,
    79+ / $re_add(b981) DLDI "all '::value' not forming an operand to an operator \
    80+ and not after a qualified type-id in class scope" @ "other value \
    81+ contexts" -> '()' @ %(YBase.YStandardEx.(Memory, Tuple),
    82+ YFramework.($impl 'YCLib(DS)'.DSIO, CHRLib.StaticMapping)),
    83+ / "simplified operand of 'noexcept' without '&&'" ^ 'ynoexcept_spec'
    84+ ~ ('ynoexcept', 'noexcept')
    85+ $effective @ %YBase.YSatandardEx.FunctionAdaptor,
    86+ / %YFramework $=
    87+ (
    88+ / @ "functions %(MakeUCS2LE, MakeUCS4LE)" @ %CHRLib.CharacterProcessing
    89+ $=
    90+ (
    91+ / "initialization of result" @ "overload with string view and \
    92+ encoding" ^ "explicit construction" ~ "initializer-list",
    93+ // This supports explicit constructors, making it more \
    94+ consistent to other overloads.
    95+ / "overloads with string view, encoding and probably allocator"
    96+ ^ 'yconstfn' ~ 'inline'
    97+ ),
    98+ + $re_add(b981) $dev $lib 'YB_ATTR_nodiscard' @ "all definitions with \
    99+ %DefGetter not already having 'YB_ATTR_nodiscard'"
    100+ @ %(Helper.ShellHelper, NPL.Configuration, YCLib.XCB,
    101+ YSLib.(Core.(YApplication, YDevice, YException),
    102+ Service.(ImageProcessing, YGDI), UI.(YControl, YUIContainer))),
    103+ / DLI "platform %Win32" @ %'Helper_(DS)'.DSMain ^ 'std::uint16_t'
    104+ ~ 'double',
    105+ - "header inclusion %YCLib.Debug" @ %Helper.ShellHelper,
    106+ / %NPL $=
    107+ (
    108+ / %Configuration $=
    109+ (
    110+ / DLI "call to %MakeIndex" @ "function %TransformNode"
    111+ ^ "allocator",
    112+ / DLI "member function %NodeLoader::LoadNode" ^ "%ystdex::sfmt"
    113+ ~ "%YSLib::sfmt",
    114+ // This avoids implicit default-initialized PMR allocator.
    115+ / "minor space removal" @ "exception message"
    116+ @ "member fnction %NodeLoader::LoadNode"
    117+ ),
    118+ / DLDI "simplified function %ConvertDocumentNode" @ %SXML
    119+ ^ 'auto' ~ 'string',
    120+ / @ "function %LoadModule_std_modules" @ %Dependency $=
    121+ (
    122+ * "incorrect template string sequence from the non-empty value \
    123+ of environment variable %NPLA1_PATH split by '?' instead \
    124+ of ';'" @ "native implementation" @ "applicatives \
    125+ ('find-requirement-filename', 'require')" $since b923;
    126+ / "applicative 'find-requirement-filename'"
    127+ => 'file-required-filename'
    128+ // This is more consistent to klisp.
    129+ )
    130+ ),
    131+ / %YCLib $=
    132+ (
    133+ / $dev $lib @ 'YF_Use_XCB' @ %XCB $=
    134+ (
    135+ + $re_add(b981) 'YB_ATTR_nodiscard'
    136+ @ ("all definitions with %DefBoolNeg", "all definitions \
    137+ with %DefCvt", "all definitions with %DefPred"),
    138+ - $re_add(b981) $revert(b659) 'using platform::string_view;'
    139+ @ "namespace %platform_ex::XCB",
    140+ - $detail $impl "prefix 'platform::' before %string",
    141+ - $revert(b563) "header inclusion <atomic>'
    142+ )
    143+ + $lib "header inclusion <cstdint>",
    144+ / $lib "header inclusion %YCommon" @ (%Mutex -> "%Platform",
    145+ %Timer -> ("%Platform", "<cstdint>")),
    146+ (
    147+ + %Basic;
    148+ / ("inline namespace %basic_types" @ "namespace %platform",
    149+ 'using namespace platform::basic_types;'
    150+ @ "namespace %platform_ex") @ %Platform >> %Basic
    151+ $dep_to "simplified Platform.h",
    152+ / ("inline namespace %basic_utilities" @ "namespace %platform",
    153+ 'using namespace platform::basic_utilities;'
    154+ @ "namespace %platform_ex") @ %Container >> %Basic,
    155+ / $forced "header inclusion %Container" @ %JNI -> "%Basic",
    156+ / $revert(b894) "header inclusion \
    157+ %YBase.YStandardEx.CStandardDefinition" @ %Platform
    158+ -> "%YBase.YDefiintion" $dep_from "simplified Platform.h"
    159+ ),
    160+ / $dev $lib "reordered macro definitions" @ %YModules
    161+ // As %Documentation::YCLib.
    162+ / %YContainer $=
    163+ (
    164+ + $dep_from "header inclusion %Basic";
    165+ / $re_add(b975) $dev $lib ^ "%pair" ~ "%std::pair" $effective
    166+ @ "alias templates %(map, multimap, unordered_map, \
    167+ unordered_multimap, set, multiset, value_map, \
    168+ value_multimap, linked_map, linked_multimap, \
    169+ ordered_value_multimap, ordered_linked_map, \
    170+ ordered_linked_multimap)"
    171+ ),
    172+ * "wrong architecture detection for %YF_Platform"
    173+ @ "platform %Linux" $since b559
    174+ ),
    175+ / %YSLib $=
    176+ (
    177+ / %Adaptor.YAdaptor $=
    178+ (
    179+ / ('using ystdex::noncopyable;', 'using ystdex::nonmovable')
    180+ @ "namespace %YSLib"
    181+ >> $dep_from ("inline namespace %platform::basic_types"
    182+ @ %YCLib.Basic) $dep_to "lift basic bases",
    183+ // This is basically compatible due to the target \
    184+ namespace introduced via 'using namespace' here.
    185+ / DLDI "string library aliases"
    186+ ),
    187+ / DLDI %Core $=
    188+ (
    189+ / "local variable name"
    190+ @ "member function %ValueObject::Equals" @ %Core.YObject,
    191+ / "destructor %Application" @ %Core.YApplication
    192+ !^ 'YB_UNLIKELY',
    193+ ),
    194+ / %UI $=
    195+ (
    196+ / DLDI %YUIContaienr $=
    197+ (
    198+ + "header inclusions (%YBase.YStandardEx.Ref, <algorithm>)",
    199+ / "qualified 'YSLib::' before 'make_observer'",
    200+ / "qualified 'ystdex::' before 'bind1'"
    201+ ),
    202+ / $dev $lib %Loader $=
    203+ (
    204+ / $detail "qualified 'YSLib::' before 'make_unique'"
    205+ $effective @ "function template %CreateUniqueWidget",
    206+ / "member function %WidgetLoader::TransformUILayout" $=
    207+ (
    208+ / "qualified 'YSLib::' before 'AsNode'",
    209+ / "simplified" ^ 'auto' ~ 'ValueNode'
    210+ ),
    211+ / $detail $impl "cast to 'ZOrder'" @ "member \
    212+ function %WidgetLoader::TransformUILayout"
    213+ // To eliminate Microsoft VC++ warning: C4244.
    214+ )
    215+ ),
    216+ / %Service $=
    217+ (
    218+ / %ImageProcessing $=
    219+ (
    220+ + $re_add(b981) $dev $lib 'YB_ATTR_nodiscard'
    221+ @ "all definitions with %DefGetterMem",
    222+ + DLDI "header inclusions %YBase.YStandard.Cache",
    223+ / DLDI "qualified 'YSLib::' before 'make_shared'"
    224+ ),
    225+ / DLDI "function %FillCircle" @ %YDraw
    226+ !^ 'using namespace std;',
    227+ - DLDI 'using namespace ystdex;' @ %(YBlend, TextRenderer),
    228+ / %FileSystem $=
    229+ (
    230+ / @ "namespace %IO" $=
    231+ (
    232+ / DLDI "parameter name 'str'" @ "function template \
    233+ %VerifyDirectoryPathTail" -> 'path',
    234+ // To be consistent with other API.
    235+ + "function template %LoadMappedModule"
    236+ ),
    237+ / @ "namespace %Deployment" $=
    238+ (
    239+ + "function %CheckLocalFHSLayout with 2 parameter";
    240+ + "class %RootPathBlock" ^
    241+ ("%IO::EndsWithNonSeperator" @ %YAdaptor.Adaptor)
    242+ )
    243+ )
    244+ )
    245+ ),
    246+ / %Helper $=
    247+ (
    248+ / %ShellHelper ^ 'YB_NONNULL' $=
    249+ (
    250+ / "minor space removal" @ "constructor %DebugTimer#1"
    251+ @ '!defined(NDEBUG)',
    252+ / DLDI "internal implementation" @ "functions %TranslateTime"
    253+ ^ 'YB_NONNULL'
    254+ ),
    255+ / %Initialization $=
    256+ (
    257+ / "functions %(CheckLocalFHSLayout, GetLocalFHSRootPathOf)" $=
    258+ (
    259+ / DLI "enabled allocator in construction of initial \
    260+ %IO::Path object";
    261+ >> "namespace %Deployment" @ %YSLib.Service.FileSystem,
    262+ ),
    263+ / DLI "prenvented redundant copy of the result from \
    264+ configuration vector" @ "function %LoadConfiguration",
    265+ / DLDI "simplified function %LoadComponents" ^ $dep_from
    266+ ("%IO::LoadMappedModule" @ %YSLib.Service.FileSystem)
    267+ / DLDI "simplified function %FetchDefaultFontCache",
    268+ / DLI "simplified functions %(FetchLocalFHSRootPath, \
    269+ LoadConfiguration, SaveConfiguration)"
    270+ ^ ("%Deployment::RootPathBlock"
    271+ @ %YSLib.Service.FileSystem),
    272+ / $revert_ex(b899) "function %(FetchLocalFHSRootPath, \
    273+ FetchRootPathString)" -> "function %FetchRootPathCache"
    274+ ^ ("%Deployment::RootPathBlock" @ %YSLib.Service.FileSystem)
    275+ // These can be relplaced by %(GetSavedLocalFHSRootPath, \
    276+ GetPathString) in %RootPathBlock.
    277+ )
    278+ ),
    279+ / $lib %'YCLib_(DS)'.DSIO $=
    280+ (
    281+ + $dev $detail $impl "header inclusion %YCLib.YCommon"
    282+ @ "implementation unit";
    283+ / "header inclusion %YCommon" @ %'YCLib_(DS)'.DSIO
    284+ -> ("%Platform", "%Basic" @ 'YCL_DS') $dep_from %YCLib.Basic
    285+ ),
    286+ / DLI "simplified use of %(noncopyable, nonmovable)"
    287+ @ "namespaces %platform_ex" @ %(YCLib.XCB, 'YCLib_(DS)'.DSIO)
    288+ $dep_from ("lift basic bases"; ^ %YCLib.Basic) $=
    289+ (
    290+ - "header inclusion %YBase.StandardEx.Base" $effecitve
    291+ // This is included in %YCLib.Basic.
    292+ - "prefix 'ystdex::'",
    293+ - "prefix 'YSLib::'"
    294+ )
    295+ ),
    296+ / $re_add(b971) "updated copyright year" @ "label text"
    297+ @ "constructor %AboutPanel" @ %YReader.About,
    298+ / $re_ex(b900) "updated year" @ "%SUBTITLE2" @ "makefile" @ "platform %DS"
    299+ @ "project %YSTest"
    300+),
    301+
    302+b981
    303+(
    35304 / %Tools $=
    36305 (
    37306 / "adjusted compiler options for projects not using custom makefile"
    diff -r 986ffb3ca9d6 -r ad10f75265b2 doc/YCLib.txt
    --- a/doc/YCLib.txt Wed Dec 20 00:28:16 2023 +0800
    +++ b/doc/YCLib.txt Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2012-2023 FrankHB.
    2+ © 2012-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YCLib.txt
    1212 \ingroup Documentation
    1313 \brief YCLib 说明。
    14-\version r605
    14+\version r622
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since build 651
    1717 \par 创建时间:
    1818 2015-11-19 09:05:02 +0800
    1919 \par 修改时间:
    20- 2023-07-16 00:12 +0800
    20+ 2024-02-26 00:56 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -312,10 +312,20 @@
    312312 使用 POSIX.1 文件系统 API 的实现要求最低版本 POSIX.1-2008 。
    313313
    314314 @4.2.1 平台约定:
    315-DS 平台可沿用部分 POSIX 限制。
    316-注意 POSIX 系统限制可能不在编译时确定;非特定平台不应假定。
    315+没有实现的依赖具体平台的 API 的使用可在运行时无条件引发错误,如抛出异常。
    316+
    317+@4.2.1.1 系统限制:
    318+POSIX 系统限制可能不在编译时确定;非特定平台不应假定。
    317319 仅在 platform::FetchLimit 的实现中使用存在对应运行时配置的宏。
    318320
    321+@4.2.1.2 DS 平台:
    322+DS 平台不符合 POSIX 标准,但因使用 newlib 作为系统库,可使用部分 POSIX.1 API 并沿用部分 POSIX 限制。
    323+DS 不支持 POSIX.2 。
    324+**注释** 关于 newlib 提供的兼容接口(系统调用接口),参见 https://sourceware.org/newlib/libc.html#Stubs ;这不表示 POSIX.2 函数( https://sourceware.org/newlib/libc.html#Posix )可用。
    325+DS 平台下类 POSIX 的 API 部分语义和 POSIX 不同:
    326+ 查询文件元数据时,::stat::st_ctime 表示文件创建时间(creation time) 而非(内容或元数据的)更改时间(change time) 。
    327+ **原理** DS 只支持 FAT 文件系统,更改时间同修改时间,不需要占用其它元数据接口提供 FAT 创建时间。DSIO(@7.1.1) 和以往的 libfat 都使用 st_ctime 保存创建时间而非更改时间。
    328+
    319329 @4.2.1 标识符:
    320330 POSIX 函数视为全局命名空间成员。
    321331 在 YCLib::NativeAPI(@5.2) 中 #undef 对应的宏以使函数可被直接(不需要在标识符外以括号保护)使用。
    @@ -335,11 +345,15 @@
    335345
    336346 @5.2 NativeAPI :
    337347 提供平台相关的 API 实现,也可在全局命名空间补充特定平台的兼容接口声明或定义的修复。
    348+NativeAPI 按 Platform(@5.1) 的定义提供平台特定的功能特性 API 。部分 API 仅供内部实现使用。
    338349
    339350 @5.3 适配模块:
    340351 类似 YSLib::Adaptor([Documentation::YSLib @@2.1]) ,在 YCLib 的顶级平台命名空间([Documentation::YFramework @@2.3.4]) 引入声明。
    341352
    342-@5.3.1 Reference 指针和引用访问操作模块:
    353+@5.3.1 Basic 基本接口:
    354+在命名空间 platform 中提供命名空间 basic_types 和 basic_utilities(@1.3.1.1) 。
    355+
    356+@5.3.2 Reference 指针和引用访问操作模块:
    343357 在这个模块中配置和声明智能指针等引用对象类型。
    344358 之前被作为 YSLib::Adaptor::YReference ,在 YSLib 命名空间引入外部名称。
    345359 可包装 Loki 或 std::tr1 指针智能等实现。
    @@ -351,13 +365,13 @@
    351365 部分名称从 YBase([Documentation::YBase]) 的命名空间 ystdex 中引入。
    352366 引入的命名空间来源通常属于实现细节,不应被依赖。
    353367
    354-@5.3.2 容器、拟容器和适配器 Container :
    368+@5.3.3 容器、拟容器和适配器 Container :
    355369 包含标准库容器相关的头,并在顶级平台命名空间([Documentation::YFramework @@2.3.4]) 引入相关名称。
    356370 之前被作为 YSLib::Adaptor::YContainer ,在 YSLib 命名空间引入外部名称。
    357371 包含 CHRLib([Documentation::CHRLib]) 的 CHRDefinition 。
    358372 build 593 起从 YSLib::Adaptor 迁移至 YCLib ,在 platform 命名空间引入外部名称。
    359373
    360-@5.3.3 互斥量 Mutex :
    374+@5.3.4 互斥量 Mutex :
    361375 基于 YBase 的 YStandardEx::PseudoMutex([Documentation::YBase @@2.5.8.16]) 为多线程和单线程环境提供统一的同步接口。
    362376 在命名空间 platform 中提供 Concurrency 和 Threading 两个子命名空间,再在其中引入外部名称。
    363377
    diff -r 986ffb3ca9d6 -r ad10f75265b2 doc/YFramework.txt
    --- a/doc/YFramework.txt Wed Dec 20 00:28:16 2023 +0800
    +++ b/doc/YFramework.txt Tue Feb 27 00:28:20 2024 +0800
    @@ -1,5 +1,5 @@
    11 /*
    2- © 2009-2023 FrankHB.
    2+ © 2009-2024 FrankHB.
    33
    44 This file is part of the YSLib project, and may only be used,
    55 modified, and distributed under the terms of the YSLib project
    @@ -11,13 +11,13 @@
    1111 /*! \file YFramework.txt
    1212 \ingroup Documentation
    1313 \brief YFramework 设计和实现说明。
    14-\version r1657
    14+\version r1668
    1515 \author FrankHB <frankhb1989@gmail.com>
    1616 \since 早于 build 132
    1717 \par 创建时间:
    1818 2009-12-02 05:14:30 +0800
    1919 \par 修改时间:
    20- 2023-03-06 12:57 +0800
    20+ 2024-02-25 22:10 +0800
    2121 \par 文本编码:
    2222 UTF-8
    2323 \par 模块名称:
    @@ -96,16 +96,13 @@
    9696 实现可假定程序不存在使用 POSIX fork 引起进程内环境变量的并发数据竞争。
    9797
    9898 @1.4.1.5 外部环境:
    99-作为符合和其它软件规范约定的一部分,除非应用另行指定,以下环境变量被支持:
    100-NO_COLOR :若这个环境变量被设置为非空值,宿主实现环境忽略终端支持的彩色和其它视觉效果格式(如下划线)特性。
    99+作为符合和其它软件规范约定的一部分,除非应用另行指定,在 https://frankhb.github.io/YSLib-book/Run.zh-CN.html#%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F 中指定的环境变量被支持。
    101100 除标准库和系统配置外,YFramework 可使用以下环境变量改变运行时行为:
    102101 YF_DEBUG_OUTPUT :若这个环境变量的值设置为 1 ,使用调试日志(@5.3) 。
    103102 当前仅在 Windows 平台使用。
    104103 YF_Use_tput :若这个环境变量被设置为非空值,宿主实现环境需要终端特性时,使用 tput 命令而不是内建的终端控制字符序列发送控制命令。
    105104 当前仅在非 Windows 平台使用。
    106105 除非另行指定,程序可假定以上环境变量不变,即仅在程序初始化时检查一次。
    107-**注释**
    108-NO_COLOR 符合 https://no-color.org/ 的约定。
    109106
    110107 @1.4.2 资源分类:
    111108 基本内容参见 [Documentation::CommonRules @@2.3.2.2] 。
    @@ -409,9 +406,10 @@
    409406
    410407 @2.1.3.2 语言扩展:
    411408 可选使用源代码语义兼容 GCC 的 128 位整数,作为替代的优化实现。
    412-在 [Documentation::YBase @@2.1.1.2] 的基础上,实现允许以下可选的语言扩展作为替代的优化实现:
    409+在 [Documentation::YBase @@2.1.1.2] 的基础上,实现允许以下可选的语言扩展作为增强或替代的优化实现:
    413410 __builtin_add_overflow
    414411 __builtin_mul_overflow
    412+__builtin_object_size
    415413 __builtin_sub_overflow
    416414 _umul128
    417415 在 [Documentation::YBase @@2.1.1.2] 的基础上,实现允许以下可选的语言扩展作为提供可选增强的实现特性:
    @@ -469,7 +467,9 @@
    469467
    470468 @2.1.6 预处理附加规则:
    471469 对公开的 YFramework 头文件包含依赖关系,在 #include 指令中使用 YFM_* 宏而不是文件名(因此仅修改头文件名时不变更版本([Documentation::ProjectRules @@2.2.6]));之前需要包含对应的 "YModules.h" (若在当前头文件中存在则使用直接相对路径,否则使用相对 YFramework/include 的路径)。
    472-指定限定平台集合(@2.1.4) 的宏(如 YF_Hosted )不得被用于出现在 YSLib 中用于条件编译(关于依赖性限制,参见 @2.2.5)。
    470+指定限定平台集合(@2.1.4) 的宏(如 YF_Hosted )不得被用于 YSLib 中用于条件包含。
    471+YF_Hosted 以外的指定限定平台集合(@2.1.4) 的宏不得被用于 NPL 中用于条件包含。
    472+关于依赖性限制,参见 @2.2.5 。
    473473
    474474 @2.2 文件依赖性:
    475475 YSLib 和 Helper(@2.8) 文件中,文件名以 y 或 Y 起始且非限定模块名以 Y 起始的文件为必要文件,其它为非必要文件。
    @@ -582,7 +582,7 @@
    582582 @2.4.2 对象引用和所有权管理:
    583583 基本概念参见 [Documentation::CommonRules @@2.3.4] 。
    584584 实现方式应符合 [CommonRules::LanguageConvention @@5.2.9.3.1] 和 [Documentation::LanguageConvention @@6.9.2] 。
    585-以下 API 中的非限定名称在 YFramework 代码对应的命名空间中可用,可能由 YCLib.Reference([Documentation::YCLib @@5.3.1]) 从不同命名空间中引入。
    585+以下 API 中的非限定名称在 YFramework 代码对应的命名空间中可用,可能由 YCLib.Reference([Documentation::YCLib @@5.3.2]) 从不同命名空间中引入。
    586586 注意基于非透明引用计数实现的非侵入式智能指针(如 boost::shared_ptr/std::tr1::shared_ptr 以及 C++11 的 std::shared_ptr )具有以下固有的缺点:
    587587 无法修改引用计数并直接转移所有权,资源实例的生存期依赖至少一个具体智能指针对象的生存期;
    588588 资源实例对智能指针对象的上述依赖性导致智能指针类型入侵用户程序接口;
    Show on old repository browser