Boost logo

Boost :

From: Valentin Bonnard (Bonnard.V_at_[hidden])
Date: 2000-01-29 15:01:31


Ed Brey wrote:

> A problem with overloading functions in std is that it makes it harder to
> prevent newer versions of the Standard from breaking old code.

Same w/ specialisation:

// <foo>
namespace std {
  template <class T, class U>
  struct foo;

#ifdef __cplusplus2000
  template <class T>
  struct foo<T, int> {};
#endif
}

// bar.cc
// (c) Dave Null 1999
#include <foo>

template <class U>
struct std::foo<int, U> {};

std::foo<int,int> foo_int_int;

That multi-methods easily break because of ambiguities when
two persons independently add overriding functions is well-
known in the OO community.

-- 
Valentin Bonnard

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