11/*
2- * Example: ex07_custom_policy
2+ * Example: ex09_custom_policy
33 *
44 * Purpose:
55 * Show end-to-end customization of all policy dimensions (type, value,
@@ -24,14 +24,14 @@ import mcpplibs.primitives.operations.invoker;
2424using namespace mcpplibs ::primitives;
2525
2626namespace demo {
27- // Point 7 / Step 1: Define one custom tag for each policy dimension.
27+ // Point 9 / Step 1: Define one custom tag for each policy dimension.
2828struct custom_value {};
2929struct custom_type {};
3030struct custom_error {};
3131struct custom_concurrency {};
3232} // namespace demo
3333
34- // Point 7 / Step 2: Register tags into policy::traits.
34+ // Point 9 / Step 2: Register tags into policy::traits.
3535template <> struct mcpplibs ::primitives::policy::traits<demo::custom_value> {
3636 using policy_type = demo::custom_value;
3737 static constexpr bool enabled = true ;
@@ -57,7 +57,7 @@ struct mcpplibs::primitives::policy::traits<demo::custom_concurrency> {
5757 static constexpr auto kind = category::concurrency;
5858};
5959
60- // Point 7 / Step 3A: Implement custom type handler.
60+ // Point 9 / Step 3A: Implement custom type handler.
6161// Always allow and negotiate through std::common_type_t.
6262template <operations::operation OpTag, typename LhsRep, typename RhsRep>
6363struct mcpplibs ::primitives::policy::type::handler<demo::custom_type, OpTag,
@@ -68,7 +68,7 @@ struct mcpplibs::primitives::policy::type::handler<demo::custom_type, OpTag,
6868 using common_rep = std::common_type_t <LhsRep, RhsRep>;
6969};
7070
71- // Point 7 / Step 3B: Implement custom concurrency handler.
71+ // Point 9 / Step 3B: Implement custom concurrency handler.
7272template <operations::operation OpTag, typename CommonRep,
7373 typename ErrorPayload>
7474struct mcpplibs ::primitives::policy::concurrency::handler<
@@ -115,7 +115,7 @@ struct mcpplibs::primitives::policy::concurrency::handler<
115115 }
116116};
117117
118- // Point 7 / Step 3C: Implement custom value handler.
118+ // Point 9 / Step 3C: Implement custom value handler.
119119// Complex point: finalize() post-processes decision and adjusts output.
120120template <operations::operation OpTag, typename CommonRep,
121121 typename ErrorPayload>
@@ -138,7 +138,7 @@ struct mcpplibs::primitives::policy::value::handler<demo::custom_value, OpTag,
138138 }
139139};
140140
141- // Point 7 / Step 3D: Provide binding for custom value policy + Addition.
141+ // Point 9 / Step 3D: Provide binding for custom value policy + Addition.
142142// Without this specialization, runtime::run_value static_assert will fail.
143143template <typename CommonRep>
144144struct mcpplibs ::primitives::operations::runtime::op_binding<
@@ -154,7 +154,7 @@ struct mcpplibs::primitives::operations::runtime::op_binding<
154154 }
155155};
156156
157- // Point 7 / Step 3E: Implement custom error handler.
157+ // Point 9 / Step 3E: Implement custom error handler.
158158template <operations::operation OpTag, typename CommonRep,
159159 typename ErrorPayload>
160160struct mcpplibs ::primitives::policy::error::handler<demo::custom_error, OpTag,
@@ -169,7 +169,7 @@ struct mcpplibs::primitives::policy::error::handler<demo::custom_error, OpTag,
169169};
170170
171171int main () {
172- // Point 7 / Step 4: Compose all custom tags and execute a call path.
172+ // Point 9 / Step 4: Compose all custom tags and execute a call path.
173173 using custom_t = primitive<int , demo::custom_value, demo::custom_type,
174174 demo::custom_error, demo::custom_concurrency>;
175175
0 commit comments