Is it possible to infer a template's return type from what it's
assigned to? If not is this a difficult or worthless feature to
add?
OUT fun(IN, OUT)(IN value) {
return value.to!OUT;
}
void main() {
float a = 5.0;
int b = fun(a);
}
On Wednesday, 11 April 2018 at 14:26:53 UTC, ixid wrote:
Is it possible to infer a template's return type from what it's
assigned to? If not is this a difficult or worthless feature to
add?
Not really. The function call needs to make sense by itself:
fun(a)
needs to be a complete thing for a
On Wednesday, 11 April 2018 at 14:33:06 UTC, Adam D. Ruppe wrote:
On Wednesday, 11 April 2018 at 14:26:53 UTC, ixid wrote:
Is it possible to infer a template's return type from what
it's assigned to? If not is this a difficult or worthless
feature to add?
Not really. The function call needs t
On 4/11/18 10:26 AM, ixid wrote:
Is it possible to infer a template's return type from what it's assigned
to? If not is this a difficult or worthless feature to add?
OUT fun(IN, OUT)(IN value) {
return value.to!OUT;
}
void main() {
float a = 5.0;
int b = fun(a);
}
Sort of:
vo
On Wednesday, 11 April 2018 at 02:37:39 UTC, bachmeier wrote:
On Monday, 9 April 2018 at 19:17:20 UTC, Adam D. Ruppe wrote:
[...]
I had a chance to try this out and it worked without a problem.
I did have to download color.d in addition to the other
dependencies you listed. In the event that
Is this a known bug? With v2.079.0, with or without -dip1000:
@safe unittest
{
struct S
{
int i;
}
auto p = &S().i;
}
The address of field `i` should not escape, right? It's also
incorrectly allowed when using an lvalue of S (when -dip1000 is
not present).
On Wednesday, April 11, 2018 16:08:06 Nick Treleaven via Digitalmars-d-learn
wrote:
> Is this a known bug? With v2.079.0, with or without -dip1000:
>
> @safe unittest
> {
> struct S
> {
> int i;
> }
> auto p = &S().i;
> }
>
> The address of field `i` should not escape,
A healthcare facility called River's Edge Hospital and Clinic in
Minnesota is using a special video interpretation service that
can connect an interpreter with a patient through a video
conference to offer necessary interpretation services.If the
patient feels that there is an inadequacy in the
I am trying to do a binary insert into my sorted array.
To sort classes and structs I would like to give a delegate `(t)
=> t.myValue` to sort on that value whitout having to implement
an interface or specifically declare opCmp for every class I want
to have sorted.
After all, I might want one
On Tuesday, 10 April 2018 at 23:59:08 UTC, Steven Schveighoffer
wrote:
On 4/9/18 6:56 PM, Jonathan wrote:
On Monday, 9 April 2018 at 22:53:31 UTC, Jonathan wrote:
On Monday, 9 April 2018 at 22:49:07 UTC, Cym13 wrote:
I don't know, but I can't reproduce either with dmd or ldc.
What was your com
On Wednesday, 11 April 2018 at 21:07:03 UTC, Sjoerd Nijboer wrote:
class SortedList(T, int function(T) comparer)
I would say, alias template parameter is your friend.
https://dlang.org/spec/template.html#TemplateAliasParameter
´´´
import std.stdio;
import std.range;
void main()
{
aut
On Wednesday, 11 April 2018 at 21:29:27 UTC, Alex wrote:
I would say, alias template parameter is your friend.
https://dlang.org/spec/template.html#TemplateAliasParameter
class SortedList(T, alias comparer)
It works, thank you!
But just to be shure, there's no way to have this more strongly
t
On Wednesday, 11 April 2018 at 15:20:08 UTC, Martin Tschierschke
wrote:
My question in the moment is, how do I invoke Thunderbird to
display a certain single mail (or maildir) file?
How do I use Thunderbird as the client, to show, to answer or
to forward these mails.
An alternative would be to
On Wednesday, 11 April 2018 at 22:13:33 UTC, Sjoerd Nijboer wrote:
On Wednesday, 11 April 2018 at 21:29:27 UTC, Alex wrote:
I would say, alias template parameter is your friend.
https://dlang.org/spec/template.html#TemplateAliasParameter
class SortedList(T, alias comparer)
It works, thank you
On Wednesday, 11 April 2018 at 16:25:20 UTC, Jonathan M Davis
wrote:
[...]
Adding a destructor makes the compiler return an error about
lifetimes, with or without -dip1000
https://run.dlang.io/is/ddXqNu
With a directory structure as follows:
run/
A/
a.d
Where a.d is:
===
module A.d;
I'm attempting to compile from the run/ directory. If I run with
dmd ../A/a.d
it compiles successfully, however if I pass it the directory
dmd -I=../A a.d
it doesn't compi
On Thursday, 12 April 2018 at 06:22:30 UTC, Nicholas Wilson wrote:
On Thursday, 12 April 2018 at 05:39:21 UTC, Jamie wrote:
Am I using the -I compiler option incorrectly?
is it thinking /../A is an absolute path?
try -I=./../A
Er, scratch that. I see you already tried it.
On Thursday, 12 April 2018 at 05:39:21 UTC, Jamie wrote:
With a directory structure as follows:
run/
A/
a.d
Where a.d is:
===
module A.d;
I'm attempting to compile from the run/ directory. If I run with
dmd ../A/a.d
it compiles successfully, however if I p
On Thursday, 12 April 2018 at 05:39:21 UTC, Jamie wrote:
Am I using the -I compiler option incorrectly?
I believe so. I think it is for finding import files, not the
files you are compiling.
-
-I=directory
Look for imports also in
Hi,
I compiled a linux application on my pc (Windows subsystem for
Linux) and copied it to AWS EMR (linux) system.
The application should execute the console application "aws".
Most of the time
the exception "Process does not exist or is not a child process."
is raised.
If I execute the appl
20 matches
Mail list logo