I have a tree structure of nodes likes this:

```
struct Node {};
struct ChildNode : Node{};

```

I'll be doing this:

```
Node* n = new ChildNode;

```

At a later point, I need to know the node type:

```
if (IsChildNode(n)) {
    ChildNode* c = static_cast<ChildNode*>(n);
    // ...
}

```

Normally, I do this by adding a virtual `Id()` method to the Node base class, and override that in the derrived class. 

In my current case, that's the only method that needs to be virtual, so I'm trying to see if there is a way to avoid the virtual methods while, at the same time, making the Id a compile-time value (not a non-const member-variable in Node class).

Is there a way to figure out the type of ChildNode without:

* using dynamic\_cast
* Without using a virtual function
* Without setting a runtime variable in the Node class.

I'm using C++ 17, on Visual Studio 2019