Type Qualifiers and Wild Cards

Gor Gyolchanyan gor.f.gyolchanyan at gmail.com
Tue Nov 8 09:21:50 PST 2011


Actually, I can make it a library solution right now.
Just provide a template, which takes a symbolic representation of
constness and a type and constructs the appropriately const type.
And a template, which extracts the const-ness of a type.
It's gonna look ugly, but it will work.

On Tue, Nov 8, 2011 at 9:02 PM, so <so at so.so> wrote:
> On Tue, 08 Nov 2011 18:56:59 +0200, Gor Gyolchanyan
> <gor.f.gyolchanyan at gmail.com> wrote:
>
>> Unless you write a template constraint, this will force you to use the
>> same type, instead of the same storage class.
>>
>> On Tue, Nov 8, 2011 at 8:42 PM, so <so at so.so> wrote:
>>>
>>> On Tue, 08 Nov 2011 16:39:35 +0200, so <so at so.so> wrote:
>>>
>>>> auto fun(return(type) a, ...)
>>>> return(T) fun(return(S) a, ...)
>>>
>>> Damn, nobody likes it, and i was expecting at least a nobel prize on
>>> math.
>>>
>
> return(T) fun(return(S) a, ...)
>
> Functions just like inout right now, and with:
>
> auto fun(return(type) a, ...)
>
> I meant to suggest if not said otherwise (as in the case above) we can just
> go return what it was passed.
> (I am not sure, probably inout already does this too)
>


More information about the Digitalmars-d mailing list