On Tuesday, 20 October 2015 at 18:08:33 UTC, Ali Çehreli wrote:
On 10/20/2015 08:48 AM, Andrea Fontana wrote:
It happens I need to perform an operation just one time
(inside a
function, a loop...)
An idea that uses a function pointer where the first step does
its task and then sets the
On 10/20/2015 08:48 AM, Andrea Fontana wrote:
It happens I need to perform an operation just one time (inside a
function, a loop...)
An idea that uses a function pointer where the first step does its task
and then sets the stage for the following steps:
import std.stdio;
import std.range
On Tuesday, 20 October 2015 at 16:01:58 UTC, Andrea Fontana wrote:
On Tuesday, 20 October 2015 at 15:55:47 UTC, John Colvin wrote:
Be aware that there will be one instance of val per thread, so
you are detecting the first run in each thread, not in the
program overall.
This is the kind of thi
On Tuesday, 20 October 2015 at 15:55:47 UTC, John Colvin wrote:
Be aware that there will be one instance of val per thread, so
you are detecting the first run in each thread, not in the
program overall.
This is the kind of thing I'm interested in.
What happens if I call isFirstTime!"test" acr
On Tuesday, 20 October 2015 at 15:48:47 UTC, Andrea Fontana wrote:
It happens I need to perform an operation just one time (inside
a function, a loop...)
I wonder if doing this it's a good idea or not.
bool isFirstTime(alias T)()
{
static val = true;
if
It happens I need to perform an operation just one time (inside a
function, a loop...)
I wonder if doing this it's a good idea or not.
bool isFirstTime(alias T)()
{
static val = true;
if (val)
{
val = false;
return