dmd 1.053 and 2.037 release

klickverbot klickverbot at gmail.com
Mon Dec 7 07:10:52 PST 2009


Max Samukha wrote:
> 
> I think the following real-world code is a good argument against comma
> operators:
> 
> template <typename T>
> Q_INLINE_TEMPLATE void QList<T>::node_destruct(Node *from, Node *to)
> {
>     if (QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic)
>         while(from != to) --to, delete reinterpret_cast<T*>(to->v);
>     else if (QTypeInfo<T>::isComplex)
>         while (from != to) --to, reinterpret_cast<T*>(to)->~T();
> }

I have never used the comma operator in my own code, but in my opinion this 
particular piece of code is really easy and fluent to read. 
»Maintainability« is admittedly, however, a different topic.


More information about the Digitalmars-d-announce mailing list