welder 0.1.0
Bindings for annotated C++ types, from C++26 reflection
Loading...
Searching...
No Matches
welder::detail::tparam_spec< N, M > Struct Template Reference

The stored form of a tparam annotation: one template parameter's doc. More...

#include <welder/annotations.hpp>

Public Attributes

fixed_string< N > name
 The documented template parameter's name.
fixed_string< M > text
 Its documentation.

Detailed Description

template<size_type N, size_type M>
struct welder::detail::tparam_spec< N, M >

The stored form of a tparam annotation: one template parameter's doc.

A template parameter is not a reflectable entity either (P2996 exposes no template-parameter API), so — like a return value — its documentation rides on the template itself, as a repeatable annotation naming the parameter:

template <class K, class V>
struct [[=welder::doc("A dictionary."),
=welder::tparam("K", "the key type"),
=welder::tparam("V", "the mapped type")]] Dict { ... };
consteval detail::doc_spec< N > doc(const char(&s)[N])
Attach a docstring to a namespace, class, function, or function parameter.
consteval detail::tparam_spec< N, M > tparam(const char(&name)[N], const char(&text)[M])
Document a template parameter (repeatable, ordered).

Consumers: the Doxygen INPUT_FILTER renders each as a @tparam K text line; reflection reads them back via tparam_docs() (<welder/doc.hpp>) — off an instantiation*, since P2996 refuses annotations_of on the uninstantiated template.

Template Parameters
Nthe parameter-name length (deduced).
Mthe text length (deduced).

Definition at line 309 of file annotations.hpp.

Member Data Documentation

◆ name

The documented template parameter's name.

Definition at line 310 of file annotations.hpp.

◆ text

Its documentation.

Definition at line 311 of file annotations.hpp.


The documentation for this struct was generated from the following file: