# C++ Polymorphic Subobject Dynamic Cast Resolver

> C++ Polymorphic Subobject Dynamic Cast Resolver is a paid API for AI agents from detect.halowerk.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-11-05).

Resolves the target subobject (or null/ill-formed result) for C++ dynamic_cast operations on a specified most-derived object, including downcasts, crosscasts, repeated bases, and virtual base sharing, without using runtime addresses.

## Facts

- Endpoint: POST https://detect.halowerk.com/v1/F-A-NIGHT-OS-CPP-CAST/cpp-polymorphic-subobject-dynamic-cast?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-05
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/c-polymorphic-subobject-dynamic-cast-resolver-52f12e37
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qS7Bd5nLPFuYLdUwxVrZ3

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability c-polymorphic-subobject-dynamic-cast-resolver-52f12e37 -d '<json body>'
```

Example prompt: I have a C++ class hierarchy where class 0 inherits virtually from class 1 and directly from class 2, and the most-derived object is class 0. Can you resolve what dynamic_cast returns when I cast from a source subobject of class 1 (occurrence 0) to target class 2?

## When to prefer this

Choose this endpoint when you need to resolve C++ dynamic_cast outcomes offline — particularly for static analysis tools, code generators, or test fixture authors who need precise subobject resolution across complex hierarchies involving virtual bases, repeated bases, or diamond inheritance, without a live C++ runtime.

## Known failure modes

- Circular or malformed class hierarchy causes computation error
- Query references a class index not defined in the classes array
- source_occurrence index exceeds the number of occurrences of that class in the hierarchy
- Exceeds maximum of 512 classes or 512 queries per request
- Invalid or missing required fields returns schema validation error

## How this service works

An offline C++ polymorphic-inheritance fixture author needs the target SUBOBJECT or null/illformed result for source-subobject-specific downcasts/crosscasts, including repeated and virtual base sharing, without addresses.

## Output

Returns, for each submitted query, the resolved target subobject identifier that dynamic_cast would yield at runtime (given the described class hierarchy and most-derived type), or indicates a null or ill-formed result — all computed offline without runtime addresses.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "artifact": {
   "type": "object",
   "required": [
    "cpp_dynamic_cast"
   ],
   "properties": {
    "cpp_dynamic_cast": {
     "type": "object",
     "required": [
      "claim",
      "classes",
      "most_derived",
      "queries"
     ],
     "properties": {
      "claim": {
       "type": "number",
       "maximum": 1000000000000,
       "minimum": -1000000000000
      },
      "classes": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "bases"
        ],
        "properties": {
         "bases": {
          "type": "array",
          "items": {
           "type": "object",
           "required": [
            "class",
            "virtual"
           ],
           "properties": {
            "class": {
             "type": "number",
             "maximum": 1000000000000,
             "minimum": -1000000000000
            },
            "virtual": {
             "type": "boolean"
            }
           },
           "additionalProperties": false
          },
          "maxItems": 512
         }
        },
        "additionalProperties": false
       },
       "maxItems": 512
      },
      "queries": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "source_class",
         "source_occurrence",
         "target_class"
        ],
        "properties": {
         "source_class": {
          "type": "number",
          "maximum": 1000000000000,
          "minimum": -1000000000000
         },
         "target_class": {
          "type": "number",
          "maximum": 1000000000000,
          "minimum": -1000000000000
         },
         "source_occurrence": {
          "type": "number",
          "maximum": 1000000000000,
          "minimum": -1000000000000
         }
        },
        "additionalProperties": false
       },
       "maxItems": 512
      },
      "most_derived": {
       "type": "number",
       "maximum": 1000000000000,
       "minimum": -1000000000000
      }
     },
     "additionalProperties": false
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/c-polymorphic-subobject-dynamic-cast-resolver-52f12e37/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from detect.halowerk.com](https://www.zero.xyz/host/detect.halowerk.com/llms.txt)
