220 5298 <CAEn_SP+DOsLN5NezjN-OvPoDfiyMEWYzXBzKhjJ88NB_-TnyOw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Martinho Fernandes <martinho.fernandes@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Overloaded Declarators
Date: Fri, 5 Jul 2013 15:57:23 +0200
Lines: 81
Approved: news@gmane.org
Message-ID: <CAEn_SP+DOsLN5NezjN-OvPoDfiyMEWYzXBzKhjJ88NB_-TnyOw@mail.gmail.com>
References: <82b89c5e-ce4e-49c0-82b2-d6032631e3e3@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1373032645 26869 80.91.229.3 (5 Jul 2013 13:57:25 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 5 Jul 2013 13:57:25 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDXL3FEUYQARBQ5B3OHAKGQEK4HOGTA@isocpp.org Fri Jul 05 15:57:26 2013
Return-path: <std-proposals+bncBDXL3FEUYQARBQ5B3OHAKGQEK4HOGTA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yh0-f70.google.com ([209.85.213.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDXL3FEUYQARBQ5B3OHAKGQEK4HOGTA@isocpp.org>)
	id 1Uv6Vp-000332-7O
	for gclcip-std-proposals@m.gmane.org; Fri, 05 Jul 2013 15:57:25 +0200
Original-Received: by mail-yh0-f70.google.com with SMTP id l109sf2987992yhq.9
        for <gclcip-std-proposals@m.gmane.org>; Fri, 05 Jul 2013 06:57:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=x-beenthere:mime-version:in-reply-to:references:date:message-id
         :subject:from:to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:x-google-group-id
         :list-post:list-help:list-archive:list-subscribe:list-unsubscribe
         :content-type:content-transfer-encoding;
        bh=uilOTOhzunmOtrv5cKtZNVcCTGcSsI1ylcE2p7vCHAQ=;
        b=dBeTtucuv9Z1tI8z6gkQokKXXMl2RuacYPu4jxxGee9ytxm2Vac3OPg++rSpq2Rt07
         mkOH5cqAQqv/IlbnfLmBQqw35/bWFMDcdzKDoXSHsTOUGZUlScmA7QXJRQ5UgB/yBVDQ
         RLPhHe3n8/I5lIJ/7V5FXpITVx6ffAUl1a3/3hSOJhGDTKJVlTv/t+pzrYOiKPiM+06T
         VWVHjBx7+FFiKUJ9+c/rFciHxA+0k3IOMNP7LKQdl6kW28I16LvNAmKdsNw5VURd+mHw
         NJfnZYTBOMtwlGUWRdl6hQ9wmaA8Q9uWshrIJTakdn975pAXUZavye89nbhU7rovjQVD
         KFTA==
X-Received: by 10.236.55.129 with SMTP id k1mr5276610yhc.1.1373032644348;
        Fri, 05 Jul 2013 06:57:24 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.120.234 with SMTP id lf10ls938162qeb.49.gmail; Fri, 05 Jul
 2013 06:57:23 -0700 (PDT)
X-Received: by 10.49.58.70 with SMTP id o6mr6359767qeq.1.1373032643665;
        Fri, 05 Jul 2013 06:57:23 -0700 (PDT)
Original-Received: from mail-qe0-x229.google.com (mail-qe0-x229.google.com [2607:f8b0:400d:c02::229])
        by mx.google.com with ESMTPS id s10si2272422qan.126.2013.07.05.06.57.23
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Fri, 05 Jul 2013 06:57:23 -0700 (PDT)
Received-SPF: pass (google.com: domain of martinho.fernandes@gmail.com designates 2607:f8b0:400d:c02::229 as permitted sender) client-ip=2607:f8b0:400d:c02::229;
Original-Received: by mail-qe0-f41.google.com with SMTP id b4so1240493qen.14
        for <std-proposals@isocpp.org>; Fri, 05 Jul 2013 06:57:23 -0700 (PDT)
X-Received: by 10.49.83.37 with SMTP id n5mr6330694qey.57.1373032643568; Fri,
 05 Jul 2013 06:57:23 -0700 (PDT)
Original-Received: by 10.49.94.238 with HTTP; Fri, 5 Jul 2013 06:57:23 -0700 (PDT)
In-Reply-To: <82b89c5e-ce4e-49c0-82b2-d6032631e3e3@isocpp.org>
X-Original-Sender: martinho.fernandes@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of martinho.fernandes@gmail.com designates 2607:f8b0:400d:c02::229 as
 permitted sender) smtp.mail=martinho.fernandes@gmail.com;       dkim=pass header.i=@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:5298
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/5298>

What if I want an actual pointer now?
Mit freundlichen Gr=FC=DFen,

Martinho


On Fri, Jul 5, 2013 at 8:32 AM,  <andrewtomazos@gmail.com> wrote:
> If we view for a moment the various parts of a declarator as operations o=
n
> types:
>
>     T*: T -> pointer-to-T
>     T&: T -> lvalue-reference-to-T
>     T&&: T -> rvalue-reference-to-T
>     T[]: T -> array-of-T
>     T(): T -> function-returning-T
>     and so forth
>
> These operations take one or more types as input and produce a type as
> output.
>
> This is not dissimilar to an alias template:
>
>    template<class T>
>    using MakePointer =3D T*;
>
>    template<class T>
>    using MakeReference =3D T&;
>
> In fact we could almost say that functions are to the built-in expression
> operators, as alias templates are to the built-in declarators.
>
> So the proposed feature "Overloaded Declarators" is to enable a user-defi=
ned
> alias template to redefine the built-in meaning of a declarator.
>
> Overloaded Declarators are to the built-in declarators, as Overloaded
> Operators are to the built-in expression operators:
>
>    struct Foo{}
>
>    template<class T>
>    using operator*<Foo> =3D shared_ptr<T>;
>
>    Foo* p;  // p has type shared_ptr<T>
>
> The above shows a key use case, specializing the declarator `T*` to
> designate a user-defined smart pointer class instead of pointer-to-T for
> some set of types.
>
> Just a random idea.
>
> Enjoy,
> Andrew.
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>
>

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.



.
