You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Variables with a type that is a record whose only public non-special
members are operator() overloads are now documented as functions. For
each operator() overload, the finalizer creates a synthetic
FunctionSymbol that carries the variable name and parent but the
operator signature, return type, and source location. The original
variable and its type are hidden as implementation-defined.
Detection triggers:
- Auto-detection (on by default, controlled by `auto-function-objects`)
for records whose only public non-special members are operator()
overloads, including class templates when the variable lives in an
enclosing scope of the type.
- The `@functionobject` (or `@functor`) doc command for cases that fail
auto-detection (e.g. types with extra public members) or when
auto-detection is off.
Key implementation details:
- FunctionObjectFinalizer runs early in the pipeline (before
OverloadsFinalizer). It creates synthetic FunctionSymbol entries,
hides the variable and its type, and appends a fixed disclaimer note
about ADL and address-taking.
- FunctionSymbol gains an optional FunctionObjectImpl field that links
each synthetic function back to the operator() it models.
An example of this feature is added to the landing page.
Closes#564.
Copy file name to clipboardExpand all lines: docs/mrdocs.schema.json
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,16 @@
36
36
"title": "Automatically provide missing documentation for special functions and trivial metadata",
37
37
"type": "boolean"
38
38
},
39
+
"auto-function-objects": {
40
+
"default": true,
41
+
"description": "When true, MrDocs automatically detects function objects: constexpr variables whose type is a struct or class whose only public non-special members are operator() overloads. Set to false to disable auto-detection and rely solely on the @functionobject doc command.",
42
+
"enum": [
43
+
true,
44
+
false
45
+
],
46
+
"title": "Automatically detect function objects",
47
+
"type": "boolean"
48
+
},
39
49
"auto-relates": {
40
50
"default": true,
41
51
"description": "When set to `true`, Mr.Docs automatically finds non-member functions that are related to the current class.",
0 commit comments