On 6/19/20 12:38 PM, SealabJaster wrote:
On Friday, 19 June 2020 at 16:31:50 UTC, Paul Backus wrote:
This is a known issue:
https://issues.dlang.org/show_bug.cgi?id=1807
"Reported: 2008"... yikes.
Thanks anyway, glad to know I wasn't just going mad :)
It's somewhat difficult to solve, beca
On Friday, 19 June 2020 at 16:31:50 UTC, Paul Backus wrote:
This is a known issue:
https://issues.dlang.org/show_bug.cgi?id=1807
"Reported: 2008"... yikes.
Thanks anyway, glad to know I wasn't just going mad :)
On Friday, 19 June 2020 at 16:16:55 UTC, SealabJaster wrote:
If you take a look at this code here:
https://godbolt.org/z/4T3uLh
You can see that when using a templated alias, the compiler
fails to infer the T template parameter, but only when using
the function that also asks for the alias, i
If you take a look at this code here: https://godbolt.org/z/4T3uLh
You can see that when using a templated alias, the compiler fails
to infer the T template parameter, but only when using the
function that also asks for the alias, instead of the original
type.
I was just wondering if this is
On Saturday, 16 July 2016 at 00:29:12 UTC, Max Klimov wrote:
On Friday, 15 July 2016 at 23:07:20 UTC, Andrey wrote:
Hi guys!
Can any one tell me - how to pass an array of int's in to the
template struct at compile-time, and how to use int there?
Like this: https://dpaste.dzfl.pl/844057da81e9
On Friday, 15 July 2016 at 23:07:20 UTC, Andrey wrote:
Hi guys!
Can any one tell me - how to pass an array of int's in to the
template struct at compile-time, and how to use int there?
Like this: https://dpaste.dzfl.pl/844057da81e9 ?
Hi guys!
Can any one tell me - how to pass an array of int's in to the
template struct at compile-time, and how to use int there?
On 25/04/2016 11:16, Nick Treleaven wrote:
On Friday, 22 April 2016 at 19:09:40 UTC, David Nadlinger wrote:
alias Instantiate(alias Template, Params...) = Template!Params;
Ah, maybe I'd even seen this in passing and forgot. Good point about
aliasSeq template elements, let's make this public.
On Friday, 22 April 2016 at 19:09:40 UTC, David Nadlinger wrote:
From std.meta:
---
/*
* Instantiates the given template with the given list of
parameters.
*
* Used to work around syntactic limitations of D with regard
to instantiating
* a template from an alias sequence (e.g. T[0]!(...)
On Thursday, 21 April 2016 at 14:47:55 UTC, Nick Treleaven wrote:
I found std.meta.ApplyLeft but it doesn't seem to work here.
I've needed this before and ended up doing a workaround with a
template block and temporary alias but it might be nice if
Phobos had this. Or is there a simpler solutio
On 22/04/2016 14:40, Steven Schveighoffer wrote:
OK, I get it. I think this used to work, but I think D has long since
disallowed direct access to eponymous members.
So what you really want to do is:
staticEx!(Exception, msg)!(file, line), but of course this doesn't
follow proper grammar.
I th
On 4/22/16 6:50 AM, Nick Treleaven wrote:
On 21/04/2016 18:03, Steven Schveighoffer wrote:
This doesn't work?
alias staticEx(string msg, string file = __FILE__, size_t line =
__LINE__) = staticEx!(Exception, msg).staticEx!(file, line);
No, nor using the module dot prefix `= .staticEx!(...).st
On 21/04/2016 18:03, Steven Schveighoffer wrote:
This doesn't work?
alias staticEx(string msg, string file = __FILE__, size_t line =
__LINE__) = staticEx!(Exception, msg).staticEx!(file, line);
No, nor using the module dot prefix `= .staticEx!(...).staticEx` either:
staticex.d(3): Error: temp
On 4/21/16 10:47 AM, Nick Treleaven wrote:
Hi,
There doesn't seem to be something like this in Phobos:
alias Instantiate(alias Template, T...) = Template!T;
Here's an example of why I need it:
alias staticEx(string msg, string file = __FILE__, size_t line =
__LINE__) =
Instantiate!(.stati
Hi,
There doesn't seem to be something like this in Phobos:
alias Instantiate(alias Template, T...) = Template!T;
Here's an example of why I need it:
alias staticEx(string msg, string file = __FILE__, size_t line =
__LINE__) =
Instantiate!(.staticEx!(Exception, msg), file, line);
tem
"Nick Sabalausky" wrote in message
news:hcnlh7$ms...@digitalmars.com...
> "downs" wrote in message
> news:hcnjit$4n...@digitalmars.com...
>> Nick Sabalausky wrote:
>>> "BCS" wrote in message
>>> news:a6268ffc3898cc29d1f554d...@news.digitalmars.com...
Hello Nick,
> So...is th
"downs" wrote in message
news:hcnjit$4n...@digitalmars.com...
> Nick Sabalausky wrote:
>> "BCS" wrote in message
>> news:a6268ffc3898cc29d1f554d...@news.digitalmars.com...
>>> Hello Nick,
>>>
>>>
So...is there any trickery I
could do so that SubFoo!("sam") and SubFoo!("sam", "human") w
Nick Sabalausky wrote:
> "BCS" wrote in message
> news:a6268ffc3898cc29d1f554d...@news.digitalmars.com...
>> Hello Nick,
>>
>>
>>> So...is there any trickery I
>>> could do so that SubFoo!("sam") and SubFoo!("sam", "human") would
>>> resolve to the same subclass of Foo?
>> Make a SubFoo!(char[] s
"BCS" wrote in message
news:a6268ffc3898cc29d1f554d...@news.digitalmars.com...
> Hello Nick,
>
>
>> So...is there any trickery I
>> could do so that SubFoo!("sam") and SubFoo!("sam", "human") would
>> resolve to the same subclass of Foo?
>
> Make a SubFoo!(char[] s) that does your logic and if it
Hello Nick,
So...is there any trickery I
could do so that SubFoo!("sam") and SubFoo!("sam", "human") would
resolve to the same subclass of Foo?
Make a SubFoo!(char[] s) that does your logic and if it passesa alises to
SubFoo!(s,"")
I'd like to have a sub-class that's templated on a potentially-duplicated
name and an optional disambiguating type. To illustrate:
class Foo
{
}
/*
Three possible names/types are:
- sam, human
- zoe, human
- zoe, starship
*/
class SubFoo(char[] name, char[] type)
{
static if(name == "sam" &&
21 matches
Mail list logo