Topic: Dependent lookup and internal linkage


Author: "Al Grant" <tnarga@arm.REVERSE-NAME.com>
Date: Fri, 17 May 2002 17:02:44 GMT
Raw View
What is the rationale for the rule that objects with internal
linkage are never found in dependent name lookup, even if that
lookup is from a function with internal linkage?

It seems quite unreasonable for the following to be illegal:

  static int bit(int n) { return 1 << n; }

  template<typename T> static T tfun(void) { return bit(T(3)); }

  int f(int n) { return tfun<int>(); }


---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]