unnamed namespaces and specializations

Doug Gregor dgregor@apple.com
Fri Aug 1 16:08:00 GMT 2003


Comeau says no:

"ComeauTest.c", line 20: error: the initial explicit specialization of 
class
           "std::<unnamed>::vector<useless>" must be declared in the 
namespace
           containing the template
        class vector<useless>



On Friday, August 1, 2003, at 8:54AM, Benjamin Kosnik wrote:

> I would dearly love it if this code below is valid.

You and me both.

> I'm getting conflicting reports: g++ says no, icc says yes. I'm not
> quite certain myself, after reading 7.3.1.1 - Unnamed namespaces  and
> the other bits.
>
> Thoughts?

I'm quite sure it's invalid. We're getting the name "vector" through a 
using declaration (based on the semantics specified in 7.3.1.1/1), and 
you can't specialize through using declarations. We'd have to reopen 
the namespace "unique"  to specialize vector, but that's not possible.

	Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 931 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030801/7e2bd66d/attachment.bin>


More information about the Libstdc++ mailing list