The Detroit Pistons received a unanticipated and ignificant
recruiting victoryas a result of coming in the direction of
phrases with cost-free representative Wayne Ellington, for each
ESPN Adrian Wojnarowski. Ellington, a 6-foot-5 capturing defend,
is a vocation 38 per cent 3-stage marksman and
On Fri, Mar 08, 2019 at 01:00:43AM +, Philos Kim via Digitalmars-d-learn
wrote:
> I want to make a nested array and flatten it at run-time like this.
>
> auto nestedArray = [1, 2, [3, 4], 5];
You can't write it this way because the nested array has a different
type from the other elements. Y
On 3/7/19 8:00 PM, Philos Kim wrote:
I want to make a nested array and flatten it at run-time like this.
auto nestedArray = [1, 2, [3, 4], 5];
auto flattenedArray = myFun(nestedArray);
writeln(flattenedArray); // => [1, 2, 3, 4, 5]
How can I do this in D?
Please help me out!
There are
I want to make a nested array and flatten it at run-time like
this.
auto nestedArray = [1, 2, [3, 4], 5];
auto flattenedArray = myFun(nestedArray);
writeln(flattenedArray); // => [1, 2, 3, 4, 5]
How can I do this in D?
Please help me out!
Am 07.03.19 um 22:50 schrieb Johannes Loher:
> [...]
As a small addition, if you always want to pass the function name as a
parameter, you can simplify this to the following:
```
enum profile_scope(string name = __FUNCTION__) = "import core.stdc.stdio
: printf; printf(\""
~ name ~ "\n\"); sco
Am 07.03.19 um 22:21 schrieb Simon:
>
> Is there a way to achieve this while compiling with -betterC? I use a
> custom string struct right now, and your version needs TypeInfo,
> concatening using ~ needs the garbage collector. I have the feeling D is
> really not agreeing with the way I want to d
On Thursday, 7 March 2019 at 20:34:48 UTC, Johannes Loher wrote:
auto profile_scope(string name)
{
import std.format : format;
return q{import std.stdio : writeln; writeln("%1$s");
scope(exit)
writeln("%1$s");}.format(name);
}
void main()
{
mixin(profile_scope("func1"));
}
Is th
Am 07.03.19 um 21:07 schrieb Simon:
> Hello,
>
> I am currently porting the frontend of my instrumenting profiler to D.
> It features a C++-makro that profiles the time between entering and
> leaving a scope (achieved with con-/destructors in C++). Since D has
> scopeguards, I hoped to achieve thi
On Thursday, 7 March 2019 at 20:07:27 UTC, Simon wrote:
measure("func1");
scope(exit) measure("func1");
I would suggest just using a struct. Make its constructor do the
first measure, and its destructor do the second measure.
I betcha you can avoid mixin entirely.
On 07.03.19 11:38, spir wrote:
-1- How to enforce that subclasses implement given methods without using
"abstract", which seems to make the whole class abstract?
Not, as far as I can tell. You can't force derived classes to override
an existing implementation. And you can't omit the implementa
Am 07.03.19 um 11:38 schrieb spir:
> Hello,
>
> First, I am not very experimented with the combination of static lang
> (alloc & typing) and OO (class-based). I'm implementing a library for
> lexical analysis (lexing), with 2 minor issues:
>
> -1- How to enforce that subclasses implement given me
Hello,
I am currently porting the frontend of my instrumenting profiler
to D. It features a C++-makro that profiles the time between
entering and leaving a scope (achieved with con-/destructors in
C++). Since D has scopeguards, I hoped to achieve this by
creating a mixin that generates the fo
from [https://dlang.org/spec/attribute.html#abstract] :
---
abstract Attribute
An abstract member function must be overridden by a derived class. Only virtual
member functions may be declared abstract; non-virtual member functions and
free-standing functions cannot be declared abstract
Hello,
First, I am not very experimented with the combination of static lang (alloc &
typing) and OO (class-based). I'm implementing a library for lexical analysis
(lexing), with 2 minor issues:
-1- How to enforce that subclasses implement given methods without using
"abstract", which seems
14 matches
Mail list logo