Topic: Defect Report: "depends" poorly defined in 17.4.3.1/1
Author: "Peter Dimov" <pdimov@mmltd.net>
Date: 2000/04/18 Raw View
[Moderator's note: this defect report has been
forwarded to the C++ committee. -moderator(fjh).]
Section: 17.4.3.1 [lib.reserved.names]
17.4.3.1/1 uses the term "depends" to limit the set of allowed
specializations of standard templates to those that "depend on a
user-defined name of external linkage."
This term, however, is not adequately defined, making it possible to
construct a specialization that is, I believe, technically legal according
to 17.4.3.1/1, but that specializes a standard template for a built-in type
such as 'int'.
The following code demonstrates the problem:
#include <algorithm>
template<class T> struct X
{
typedef T type;
};
namespace std
{
template<> void swap(::X<int>::type& i, ::X<int>::type& j);
}
--
Peter Dimov
Multi Media Ltd.
---
[ 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://reality.sgi.com/austern_mti/std-c++/faq.html ]