@@ -123,17 +123,22 @@ template <typename T> T TypeFunc();
123
123
* This has no effect on @a u but fools the compiler in to thinking @a T has been used.
124
124
* This avoids metaprogramming issues with unused template parameters.
125
125
*
126
- * Suppose an API has changed a function from "delain" to "Delain". To handle this the metacase support is used, but there is
127
- * no apparent template parameter. A fake one can be used and defaulted to @c void. But that creates the unused template
128
- * parameter warning. This is fixed by doing something like
126
+ * Suppose an API has changed a function from "cheer_for_delain" to "cheer_delain". To handle this
127
+ * the metacase support is used, but there is no apparent template parameter. A fake one can be used
128
+ * and defaulted to @c void. But that creates the unused template parameter warning. This is fixed
129
+ * by doing something to erase the template parameter @a V while forwarding parameter @a x. The result
130
+ * is a function @c f that calls the correct function automatically. Note this can't be in the body of
131
+ * the function because even for SFINAE the function body must compile and the variant with the wrong
132
+ * function will fail.
133
+ *
129
134
* @code
130
135
* template <typename V = void>
131
- * auto f(UDT x, swoc::meta::CaseTag<0>) -> decltype(delain (eraser<V>(x)))
132
- * { return delain (eraser<V>(x)); }
136
+ * auto f(UDT x, swoc::meta::CaseTag<0>) -> decltype(cheer_for_delain (eraser<V>(x)))
137
+ * { return cheer_for_delain (eraser<V>(x)); }
133
138
*
134
139
* template <typename V = void>
135
- * auto f(UDT x, swoc::meta::CaseTag<1>) -> decltype(Delain (eraser<V>(x)))
136
- * { return Delain (eraser<V>(vc )); }
140
+ * auto f(UDT x, swoc::meta::CaseTag<1>) -> decltype(cheer_delain (eraser<V>(x)))
141
+ * { return cheer_delain (eraser<V>(x )); }
137
142
*
138
143
* f(x, swoc::meta::CaseArg); // Invoke the correctly named function
139
144
* @endcode
0 commit comments