Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-08-30 10:46:40


Jens Maurer wrote:

> - The library introduces some non-member functions to remain extensible.
>An extension scenario would be that a user implements his own graph
>data type implementing e.g. AdjacenyMatrix. Then I can call edge(u,v,g)
>on an object g of that graph type from anywhere and Koenig lookup will
>find the correct function. What happens if some other subsystem wants
>to be extensible as well and defines a non-member edge() function with
>a different meaning? Hm... Either the function signature disambiguates,
>or there's a problem. I must think about this separately, and it's not
>a specific problem with GGCL.

Name pollution is a serious problem with non-member functions.

It is a problem technically because of the disambiguation issue Jens
identifies above, and because humans may become confused more easily by a
non-member name than a member name with its improved context.

--Beman


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