Officially, what is typename for?

Following is the quote from Josuttis book: The keyword typename was introduced to specify that the identifier that follows is a type. Consider the following example: Here, typename is used to clarify that SubType is a type of class T. Thus, ptr is a pointer to the type T::SubType. Without typename, SubType would be considered a static member. Thus would be a multiplication of value SubType of type T with ptr.

How does #include work in C++?

It is basically a header file that also includes every standard library and STL include file. The only purpose I can see for it would be for testing and education. Se e.g. GCC 4.8.0 /bits/stdc++.h source. Using it would include a lot of unnecessary stuff and increases compilation time. Edit: As Neil says, it’s an implementation for … Read more

Error: No viable overloaded =

Your code should be You are allocating an object on heap using new operator which returns pointer to the object created and you are trying to assign a pointer to an object. Better alternative here would be allocate object on stack which you are doing it already. MemberListEntry mEntry(id, port); This creates and initializes the … Read more