On 9/20/16 3:42 PM, crimaniak wrote:
On Tuesday, 20 September 2016 at 13:35:27 UTC, Steven Schveighoffer wrote:
Note that if you don't import the module that contains the static
ctor, it should be trimmed by the linker.
Let's imagine linker can trim even imported module with static ctor, if
On Tuesday, 20 September 2016 at 13:35:27 UTC, Steven
Schveighoffer wrote:
Yes, but if your code does instantiate it, it is called, even
if you don't ever call the function that calls it.
Yes, it's not ideal but better then just global variable and
static block - it's called in any case, even
On Tuesday, 20 September 2016 at 09:14:39 UTC, Marc Schütz wrote:
Have a look at `std.concurrency.initOnce`:
https://dlang.org/phobos/std_concurrency.html#.initOnce
But you will still need to use assumePure() for calling
`thisExePath`, and it might do other things that are impure...
Yes,
On Tuesday, 20 September 2016 at 04:26:05 UTC, Jonathan M Davis
wrote:
On Tuesday, September 20, 2016 04:17:21 crimaniak via
Digitalmars-d-learn wrote:
static shared immutable ReturnType!T value;
I would point out that immutable is implicitly shared, so
there's no reason to put
On 9/20/16 12:17 AM, crimaniak wrote:
Hi and thanks all!
On Tuesday, 20 September 2016 at 00:43:10 UTC, Jonathan M Davis wrote:
immutable string executablePath;
shared static this()
{
import std.file : thisExePath();
executablePath = thisExePath();
}
This code is good for my needs
On Tuesday, 20 September 2016 at 04:17:21 UTC, crimaniak wrote:
Hi and thanks all!
On Tuesday, 20 September 2016 at 00:43:10 UTC, Jonathan M Davis
wrote:
immutable string executablePath;
shared static this()
{
import std.file : thisExePath();
executablePath = thisExePath();
}
On Tuesday, September 20, 2016 04:17:21 crimaniak via Digitalmars-d-learn
wrote:
> static shared immutable ReturnType!T value;
I would point out that immutable is implicitly shared, so there's no reason
to put shared on an immutable variable. However, you _do_ want to put shared
on a
Hi and thanks all!
On Tuesday, 20 September 2016 at 00:43:10 UTC, Jonathan M Davis
wrote:
immutable string executablePath;
shared static this()
{
import std.file : thisExePath();
executablePath = thisExePath();
}
This code is good for my needs but I start to think about how to
On Tuesday, September 20, 2016 00:37:10 Stefan Koch via Digitalmars-d-learn
wrote:
> On Tuesday, 20 September 2016 at 00:01:58 UTC, crimaniak wrote:
> > Hi!
> >
> > Is there situations when output of thisExePath() can be
> > different during runtime? If yes, what the reason?
> > If no, is this
On Tuesday, September 20, 2016 00:01:58 crimaniak via Digitalmars-d-learn
wrote:
> Hi!
>
> Is there situations when output of thisExePath() can be different
> during runtime? If yes, what the reason?
> If no, is this possible to mark it as pure in phobos?
>
>
On 9/19/16 8:01 PM, crimaniak wrote:
Hi!
Is there situations when output of thisExePath() can be different during
runtime? If yes, what the reason?
If no, is this possible to mark it as pure in phobos?
https://dlang.org/library/std/file/this_exe_path.html
Not in a way that D can ensure
On Tuesday, 20 September 2016 at 00:01:58 UTC, crimaniak wrote:
Hi!
Is there situations when output of thisExePath() can be
different during runtime? If yes, what the reason?
If no, is this possible to mark it as pure in phobos?
https://dlang.org/library/std/file/this_exe_path.html
No way
Hi!
Is there situations when output of thisExePath() can be different
during runtime? If yes, what the reason?
If no, is this possible to mark it as pure in phobos?
https://dlang.org/library/std/file/this_exe_path.html
13 matches
Mail list logo