Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-01-19 09:22:17


"Edward Diener" <eddielee_at_[hidden]> writes:

> "Fredrik Blomqvist" <fredrik_blomqvist_at_[hidden]> wrote in message
> news:b0cvd7$4dv$1_at_main.gmane.org...
>> -snip-
>> > I thought the C++ template solution by Damian Conway was pretty neat,
>> -snip-
>> I thought so too at first, but at a closer look you can see that the code
> in
>> practice only works for integers.. It solves the problem in the original
>> thread, but shouldn't be mistaken for a generic solution.
>
> It seems as if it should work for any type with a copy constructor. Perhaps
> I missed something.
>
> Nonetheless I do favor a compiler change such as allowing the "default"
> keyword to be used instead as Mr. Terekhov suggested in that same thread.
> That would be much cleaner and should be easy for any compiler to handle.
> This is one case where I would like to see the language updated with such an
> easy, transparent solution to the problem. Of course if others don't see it
> as much of a problem, they wouldn't be in favor of the solution since it
> involves the dreaded "C++ language change"

Oh, it's a problem alright, but I'm still not very convinced of that
solution. The problem with interfaces that have lots of positional
parameters is that you forget what the different positions mean. To
solve that problem, you need either named parameters or a
position-independent interface.

-- 
                       David Abrahams
   dave_at_[hidden] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk