Traits

Jul 26, 2009 12:10

I just finished reading Traits: a new and useful template technique by Nathan C. Myers. It's an interesting and powerful approach, but I had trouble getting past the elephant in the motivating example. He wanted to be able to support streams of arbitrary character types, but for each character type he needs an "int type" that is strictly wider, ( Read more... )

Leave a comment

Comments 3

ashley_y July 26 2009, 20:08:20 UTC
In a language where creating datatypes is considered lightweight, the solution is obvious. For instance, ML has "'a option", Haskell has "Maybe a". But I guess this is trickier in a language without GC.

Reply


_rck_ July 27 2009, 02:44:55 UTC
I was going to say, missing a Monad.

Reply


nickbarnes July 27 2009, 11:25:50 UTC
Inventing refinements to the C++ templates language reminds me of those people who figure out ways to say "web browser" in Latin.

Reply


Leave a comment

Up