C++ Logo

sg20

Advanced search

Re: [isocpp-ext] namespace composition

From: Jens Maurer <jens.maurer_at_[hidden]>
Date: Mon, 1 May 2023 12:43:28 +0200
On 01/05/2023 08.37, Kirk Shoop via Ext wrote:
> This seems to work.
>
> https://wandbox.org/permlink/AxbjJtysQDG1AuaS <https://wandbox.org/permlink/AxbjJtysQDG1AuaS>
>
> Excerpt:
>
> #include <vector>
> template<class t>
> concept win = true;
> namespace std {
> template<win t, win a>
> class vector<t, a> {
> public:
> void found_our_own() {}
> };
> }


[namespace.std] p2 says

"Unless explicitly prohibited, a program may add a template specialization for any standard library class
template to namespace std provided that (a) the added declaration depends on at least one program-defined
type and (b) the specialization meets the standard library requirements for the original template."

I'm not seeing your specialization to depend on a program-defined type;
a concept is not a type.

Jens

Received on 2023-05-01 10:43:32