JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
Loading...
Searching...
No Matches
jh::macro Namespace Reference

Internal macro-based utilities. More...

Functions

template<typename T>
constexpr std::string_view type_name ()
 Extract the human-readable type name of T at compile time.

Detailed Description

Internal macro-based utilities.

jh::macro contains low-level helpers implemented using compiler- or platform-specific macros.

This namespace is intended for internal infrastructure and diagnostics within the JH Toolkit. Its facilities are not part of the stable public API and should not be relied upon directly by user code.

Note
Components in this namespace may depend on compiler extensions, preprocessor macros, or platform-specific behavior. They exist to support higher-level modules indirectly.

Function Documentation

◆ type_name()

template<typename T>
std::string_view jh::macro::type_name ( )
constexpr

Extract the human-readable type name of T at compile time.

Uses compiler-specific macros (Clang/GCC PRETTY_FUNCTION) to obtain the unmangled type name of a template parameter.

Key Properties:

  • No RTTI dependency (works with -fno-rtti).
  • Result is compiler- and version-specific.
  • Evaluated entirely at compile time (constexpr).
Warning
  • Do not use this for serialization, persistence, or ABI logic.
  • Intended solely for debugging, logging, and developer diagnostics.
  • Format is not stable across compilers or versions.
Template Parameters
TThe type to inspect.
Returns
std::string_view with the extracted type name, or "unknown" if extraction fails.