I recently encountered the definition of static class in C++ while going through the source code of ns2 simulator:
static class TCPHeaderClass : public PacketHeaderClass {
public:
TCPHeaderClass() : PacketHeaderClass("PacketHeader/TCP",
sizeof(hdr_tcp)) {
bind_offset(&hdr_tcp::offset_);
}
} class_tcphdr;
I have never encountered a static class in C++ before. What are the properties and uses of the same?
That is an unusual syntax to declare a static instance of
TCPHeaderClasscalledclass_tcphdr, equivalent to