|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-05-23 12:40:07
On Wed, 23 May 2001, David Abrahams wrote:
abraha> First, a question: is anyone out there using this feature successfully?
I have.
abraha>
abraha> 1. When I try to use it, GCC chokes on whatever the last parameter in my
abraha> 3-parameter chain is. It complains (incorrectly) that I'm passing a non-type
abraha> parameter where the template expects a type.
This sounds bad.
abraha> 2. When I forgot to supply a Distance parameter for my iterator adaptor
abraha> wrapping a non-iterator Base type, I got other errors which I had lots of
abraha> trouble diagnosing. The code for handling the named template parameters is
abraha> so complicated and without substantial comments that it's hard to understand
abraha> what's going on.
abraha>
abraha> Finally, these remarks:
abraha>
abraha> It looks like the code we have in iterator_adaptor_test.cpp for testing the
abraha> named template parameter technique is inadequate, since it only tests one
abraha> case where no default parameter values are used. It didn't reveal the
abraha> problem I'm having with GCC. Given this and the complexity of the code I am
abraha> tempted to roll back the feature until more people than just Jeremy can
abraha> understand it.
I'd be ok with that, just let me know so I can make sure that I can update
places where I use it.
abraha> When using the named template parameter approach in a template, it could get
abraha> a bit unweildy because instead of writing e.g., ::value_type<T> you need to
abraha> write ::template value_type<T>. I think our documentation should make
abraha> mention of this and we should consider whether there are ways to cut down
abraha> the syntax.
That's a good point. There are some alternatives that don't have this
problem, like using separate wrappers for each parameter instead of
nesting them.
Cheers,
Jeremy
----------------------------------------------------------------------
Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
Ph.D. Candidate email: jsiek_at_[hidden]
Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk