Follow-up from issue #116 (review MINOR finding on xmscore/misc/StringUtil.h:983-998).
The new \brief paragraph for STRstd<T> (added in PR #117's predecessor docs commits) explains the overload-resolution traps the four explicit overloads exist to dodge. The reviewer's note: this is a signal that the four-overload set could likely be collapsed into one specialized template, with the special cases handled via if constexpr (C++17) or tag dispatch.
Proposed change
- Replace the four free
STRstd overloads with a single primary template plus the specializations actually needed. Use if constexpr on std::is_floating_point_v<T> / std::is_integral_v<T> where the current overloads diverge.
- Verify against existing call sites (downstream xms libraries call this through
STRstd directly).
- Update the
\brief once the overload-trap discussion is no longer needed.
Why follow-up
The reviewer explicitly tagged this as FOR FOLLOW-UP ("signal that the four-overload set could become one specialized template"). It's a real refactor with downstream impact, not a doc fix.
Acceptance
Refs: issue #116, PR #117, xmscore/misc/StringUtil.h:983-998.
Follow-up from issue #116 (review MINOR finding on
xmscore/misc/StringUtil.h:983-998).The new
\briefparagraph forSTRstd<T>(added in PR #117's predecessor docs commits) explains the overload-resolution traps the four explicit overloads exist to dodge. The reviewer's note: this is a signal that the four-overload set could likely be collapsed into one specialized template, with the special cases handled viaif constexpr(C++17) or tag dispatch.Proposed change
STRstdoverloads with a single primary template plus the specializations actually needed. Useif constexpronstd::is_floating_point_v<T>/std::is_integral_v<T>where the current overloads diverge.STRstddirectly).\briefonce the overload-trap discussion is no longer needed.Why follow-up
The reviewer explicitly tagged this as FOR FOLLOW-UP ("signal that the four-overload set could become one specialized template"). It's a real refactor with downstream impact, not a doc fix.
Acceptance
StringUtil\briefupdated to drop the overload-trap explanationRefs: issue #116, PR #117,
xmscore/misc/StringUtil.h:983-998.