On Thursday, 26 April 2018 at 06:18:25 UTC, BoQsc wrote:
On Wednesday, 25 April 2018 at 20:44:10 UTC, u0_a183 wrote:
On Wednesday, 25 April 2018 at 19:54:26 UTC, BoQsc wrote:
On Wednesday, 25 April 2018 at 19:43:31 UTC, Jonathan M Davis
wrote:
On Wednesday, April 25, 2018 19:19:58 BoQsc via
On Friday, April 27, 2018 02:59:16 Dr.No via Digitalmars-d-learn wrote:
> In C# you can have a readonly member assignable either at
> declaration or constructor time, like this:
>
> class C
> {
>readonly myClass mc;
>
>this()
>{
> mc = new myClass();
>}
>
>
>void
In C# you can have a readonly member assignable either at
declaration or constructor time, like this:
class C
{
readonly myClass mc;
this()
{
mc = new myClass();
}
void doSomething()
{
mc = new myClass(); // wrong! result in compiler error, mc is
readonly
}
}
Does D
I have a struct with a mixin(bitfields) containing many small
bitfields. I also have a class member in the struct.
And because I want the class member to compare by using `is` I
need to define
bool opEquals(const scope typeof(this) that) const @safe pure
nothrow @nogc
{
On Thursday, April 26, 2018 21:28:27 Jonathan via Digitalmars-d-learn wrote:
> Is there a way in D to take past arguments as an array? A like a
> normal Variadic function. All the arguments should be of the
> same type just as an array.
>
> Basically I want to allow a function like this to be
On 04/26/2018 11:28 PM, Jonathan wrote:
Is there a way in D to take past arguments as an array? A like a normal
Variadic function. All the arguments should be of the same type just as
an array.
Basically I want to allow a function like this to be called without
square brackets.
void
Is there a way in D to take past arguments as an array? A like a
normal Variadic function. All the arguments should be of the
same type just as an array.
Basically I want to allow a function like this to be called
without square brackets.
void fun(int[] intArray) {
//...
}
void main()
Most dub packages are libraries and should provide runnable
examples.
What's the current idiomatic way to add examples? I used
sub-packages with dependency on the library and "*" as version
and running them as dub run :examplename
Now I've noticed vibed uses a different scheme - examples are
On 04/26/2018 10:56 AM, Dr.No wrote:
> class C
> {
>
> void error(A...)(string fmt, A args)
> {
> import report : error;
> reportedAnyError = true;
> error(fmt, args);
> }
> alias warning = report.warning;
> }
>
>
> I got this:
>
> Error: undefined
consider this:
module report;
// output an error message on stderr
void error(A...)(string fmt, A args)
{
import colorize : fg, color, cwriteln, cwritefln, cwrite;
stderr.cwrite("error: ".color(fg.yellow));
cwritefln(fmt.color(fg.yellow), args);
}
void
On Wednesday, 25 April 2018 at 19:25:11 UTC, Jesse Phillips wrote:
On Wednesday, 25 April 2018 at 17:34:41 UTC, Dr.No wrote:
Is there something implemented already to get the files from
directory by name using D or I'm on my own and I have to write
it myself? I didn't find how do that with
On Wednesday, 25 April 2018 at 18:06:07 UTC, Jonathan M Davis
wrote:
On Wednesday, April 25, 2018 17:34:41 Dr.No via
Digitalmars-d-learn wrote:
Is there something implemented already to get the files from
directory by name using D or I'm on my own and I have to write
it myself? I didn't find
On Thursday, 26 April 2018 at 16:10:16 UTC, Timoses wrote:
Is it possible to use a template to place the "static foreach"
looping to find the correct enum value into? Like I am trying
in the initial "draft" GetMenum?
As the compiler says, the value of `e` is not known at
compile-time. In
The following should depict what I'm trying to achieve:
```
import std.stdio;
enum menum { A, B, C }
void main()
{
foo(menum.B);
}
void foo(menum e)
{
// Not possible
// run time variable 'e' in conjunction with template 'Temp'
writeln(Temp!(GetMenum(e)));
}
static int i
On Thursday, 26 April 2018 at 15:06:49 UTC, sungal wrote:
I have this piece of code and I can't understand why the
`static if` conditionals are always false.
```
import std.digest.sha;
import std.file;
import std.stdio;
void main()
{
auto hash1 = produceHash!string("prova.d");
auto
I have this piece of code and I can't understand why the `static
if` conditionals are always false.
```
import std.digest.sha;
import std.file;
import std.stdio;
void main()
{
auto hash1 = produceHash!string("prova.d");
auto hash2 = produceHash!File(File("./prova.d"));
}
string
On Wednesday, 25 April 2018 at 19:19:58 UTC, BoQsc wrote:
So there has been idea I've got for around few months now:
making a software which executable would contain a source file.
A software that anyone could modify by opening an executable
and quickly change a few lines of it, rerun an
On Wednesday, 25 April 2018 at 20:31:46 UTC, solidstate1991 wrote:
On Wednesday, 25 April 2018 at 15:25:42 UTC, Stefan Koch wrote:
Pass stuff on the stack ;)
and use extern (C) functions.
Thanks! What about extern (D)? Is there a big chaos in the D
ABI under x86?
I think the D abi is not
On Wednesday, 25 April 2018 at 20:44:10 UTC, u0_a183 wrote:
On Wednesday, 25 April 2018 at 19:54:26 UTC, BoQsc wrote:
On Wednesday, 25 April 2018 at 19:43:31 UTC, Jonathan M Davis
wrote:
On Wednesday, April 25, 2018 19:19:58 BoQsc via
Digitalmars-d-learn wrote:
So there has been idea I've got
19 matches
Mail list logo