Skip to content

Commit 462acd5

Browse files
committed
refine ppc::util::FuncName() documentation for clarity and brevity
1 parent e00f6ad commit 462acd5

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

modules/core/util/include/util.hpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,11 @@ using NlohmannJsonTypeError = nlohmann::json::type_error;
2727
namespace ppc::util {
2828

2929
/**
30-
* @brief Obtain the simple function name (e.g. "PreProcessing" or "foo")
31-
* from the full signature returned by std::source_location.
30+
* @brief Returns the unqualified name of the current function.
3231
*
33-
* @param loc Source location info (file, line, full signature).
34-
* Defaults to the call site via std::source_location::current().
35-
* @return A std::string with only the function’s unqualified name.
36-
*
37-
* @details
38-
* - On GCC/Clang, function_name() returns a pretty signature
39-
* including namespaces, templates, and parameters.
40-
* - On MSVC, it also includes return type and calling convention.
41-
* - This routine removes any leading scope qualifiers (“::…”) and
42-
* drops everything from the first '(' onward.
32+
* @param loc Source location, defaults to the current function.
33+
* @return Function name without namespaces or parameters.
4334
*/
44-
4535
inline std::string FuncName(const std::source_location& loc = std::source_location::current()) {
4636
std::string s{loc.function_name()};
4737
if (auto p = s.find('('); p != std::string::npos) {

0 commit comments

Comments
 (0)