static struct inet_protosw inetsw_array[] =
{
[0] = { /* assignment by index */
.type = SOCK_STREAM, /* assignment by field */
.protocol = IPPROTO_TCP,
.prot = &tcp_prot,
.ops = &inet_stream_ops,
.no_check = 0,
.flags = INET_PROTOSW_PERMANENT |
INET_PROTOSW_ICSK,
},
}
The above code works in C, but not in C++. I think the 2 methods are really nice. How C++ remove it?
PS: It seems field assignment can be accomplished by: type: SOCK_STREAM