Re: what is the point of functor ?

2018-06-24 Thread Flaze07 via Digitalmars-d-learn
On Friday, 22 June 2018 at 20:20:56 UTC, Steven Schveighoffer wrote: On 6/22/18 2:25 PM, Ali Çehreli wrote: On 06/22/2018 08:17 AM, Steven Schveighoffer wrote: > reason to use functors I wonder whether they are more efficient because a functor would carry just the state that it needs. Also,

Re: what is the point of functor ?

2018-06-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/22/18 2:25 PM, Ali Çehreli wrote: On 06/22/2018 08:17 AM, Steven Schveighoffer wrote: > reason to use functors I wonder whether they are more efficient because a functor would carry just the state that it needs. Also, there is no GC memory allocation unless the programmer wants to. I

Re: what is the point of functor ?

2018-06-22 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, June 22, 2018 14:06:06 Flaze07 via Digitalmars-d-learn wrote: > recently, I visited the glossary and saw that functor exist in > D...I know that functor exist C++ as a way to easily allow higher > order function, but since D already has function and delegates, > is there a point to

Re: what is the point of functor ?

2018-06-22 Thread Ali Çehreli via Digitalmars-d-learn
On 06/22/2018 08:17 AM, Steven Schveighoffer wrote: > reason to use functors I wonder whether they are more efficient because a functor would carry just the state that it needs. Also, there is no GC memory allocation unless the programmer wants to. I wonder how much state is allocated for a

Re: what is the point of functor ?

2018-06-22 Thread 12345swordy via Digitalmars-d-learn
On Friday, 22 June 2018 at 14:06:06 UTC, Flaze07 wrote: recently, I visited the glossary and saw that functor exist in D...I know that functor exist C++ as a way to easily allow higher order function, but since D already has function and delegates, is there a point to functor ? It there for

Re: what is the point of functor ?

2018-06-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/22/18 10:06 AM, Flaze07 wrote: recently, I visited the glossary and saw that functor exist in D...I know that functor exist C++ as a way to easily allow higher order function, but since D already has function and delegates, is there a point to functor ? D covers a lot of programming

what is the point of functor ?

2018-06-22 Thread Flaze07 via Digitalmars-d-learn
recently, I visited the glossary and saw that functor exist in D...I know that functor exist C++ as a way to easily allow higher order function, but since D already has function and delegates, is there a point to functor ?