On 16/03/11 10:30, Steven Wawryk wrote:
On 16/03/11 04:59, Andrei Alexandrescu wrote:
The reason for the allegedly ugly syntax is that it's considerably more
general. It is often the case that a struct defines an entity that is
implicitly convertible to another entity - could be an rvalue vs.
lvalue, a class vs. another struct vs. a primitive type, could need a
run-time operation etc. Inheritance would offer at best few of these
amenities, whereas 'alias this' offers all with a simple syntax.

More general?! How would you express the equivalent of
static_cast<slist_node<T> >(base) in the original sample code?

Sorry, I meant static_cast<slist_node<T> *>(base_ptr).

Reply via email to