Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2003-10-22 10:02:59


"Beman Dawes" <bdawes_at_[hidden]> wrote in message
news:4.3.2.7.2.20031022090117.03187588_at_mailhost.esva.net...
> At 03:33 AM 10/22/2003, Pavol Droba wrote:
[sip]
> >- Second resons is syntactical. If all functions would be in one
> namespace,
> > there is a big probablility of name clashes. Because the majority of
> > arguments in the algorithms is templated, the only distintion between
> > different variants of the same algorithm is the number of paramters.
> > So putting everything into one namespace would most probably imply the
> > need to rename some functions.
>
> That's probably a sign that some functions need renaming anyhow. Think
> about it - if there is so little difference between two functions in the
> same namespace that overload resolution can't tell them apart, is moving
> one of them into a sub-namespace really a good idea? Sure, overload
> resolution now works, but how is the poor programmer expected to keep the
> difference straight?

I think this is a problem that we will encounter often; I've got into the
same problem with container versions of
standard algorithms. I think having two namespaces is
the second best idea. I think having two different names is an inferior
idea. The best would be to use an enable_if
mechanism to remove the ambiguity.

I haven't used the lately accepted lib, but how portable is it? If its
portable, it might be worth looking into.

regards

Thorsten


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