On Tuesday, 8 July 2014 at 02:31:50 UTC, Átila Neves wrote:
On Monday, 7 July 2014 at 18:15:32 UTC, Sean Kelly wrote:
With asynchronous event-driven code (ie. server code), I don't
see any way to avoid all use of new / delete.
std::make_unique and std::make_shared are what you're
supposed
On Tuesday, 8 July 2014 at 14:24:10 UTC, Sean Kelly wrote:
But you're ultimately passing something as a void* to a library
call and receiving it later as the context for a callback.
That value has to live on the heap.
Well to be fair, you could make the context an index into an
array.
On Tuesday, 8 July 2014 at 14:24:10 UTC, Sean Kelly wrote:
On Tuesday, 8 July 2014 at 02:31:50 UTC, Átila Neves wrote:
On Monday, 7 July 2014 at 18:15:32 UTC, Sean Kelly wrote:
With asynchronous event-driven code (ie. server code), I don't
see any way to avoid all use of new / delete.
On Tuesday, 8 July 2014 at 15:23:30 UTC, Atila Neves wrote:
On Tuesday, 8 July 2014 at 14:24:10 UTC, Sean Kelly wrote:
On Tuesday, 8 July 2014 at 02:31:50 UTC, Átila Neves wrote:
On Monday, 7 July 2014 at 18:15:32 UTC, Sean Kelly wrote:
With asynchronous event-driven code (ie. server code),
On Tuesday, 8 July 2014 at 17:55:15 UTC, Sean Kelly wrote:
Well sure, but you can't use a class instance living on the
stack
as the context for a callback. At that point, whatever smart
pointer you're using has to be discarded. This is actually why
I
find little use for
On Tuesday, 8 July 2014 at 18:04:14 UTC, Brad Anderson wrote:
Maybe I'm misunderstanding but why not just use reset()?
reset deletes the currently referenced object.
On Tuesday, 8 July 2014 at 18:23:41 UTC, Sean Kelly wrote:
On Tuesday, 8 July 2014 at 18:04:14 UTC, Brad Anderson wrote:
Maybe I'm misunderstanding but why not just use reset()?
reset deletes the currently referenced object.
Oh, I see what you were going for now.
On Saturday, 5 July 2014 at 16:28:13 UTC, Dicebot wrote:
This is what I have been referring to in my earlier comment.
These utilities provide RAII experience very similar to one in
C++ and work pretty good if you stick to certain style of
programming. But they are implemented by using struct
On Saturday, 5 July 2014 at 06:43:31 UTC, Russel Winder via
Digitalmars-d wrote:
On Fri, 2014-07-04 at 20:25 +, Chris Cain via Digitalmars-d
wrote:
[…]
The big problem with that is C++ style memory management
implies we're going to have new/delete which AFAIK delete is
depreciated and new
On Monday, 7 July 2014 at 18:15:32 UTC, Sean Kelly wrote:
On Saturday, 5 July 2014 at 06:43:31 UTC, Russel Winder via
Digitalmars-d wrote:
On Fri, 2014-07-04 at 20:25 +, Chris Cain via
Digitalmars-d wrote:
[…]
The big problem with that is C++ style memory management
implies we're going to
On Fri, 2014-07-04 at 20:25 +, Chris Cain via Digitalmars-d wrote:
[…]
The big problem with that is C++ style memory management
implies we're going to have new/delete which AFAIK delete is
depreciated and new is currently hardcoded to use the GC.
[…]
All the C++ folk are saying that with
Chris Cain:
http://dlang.org/phobos/std_typecons.html#.Unique
I'd like to read a little tutorial for the usage of that Unuque
in D.
Bye,
bearophile
On Saturday, 5 July 2014 at 06:43:31 UTC, Russel Winder via
Digitalmars-d wrote:
All the C++ folk are saying that with C++14 is you are using
any heap at
all you are more than likely doing it wrong. Modern C++ idiom
is for
completely new/delete free code.
Minor nitpick, it is indeed devoid
On Sat, 2014-07-05 at 11:46 +, ponce via Digitalmars-d wrote:
On Saturday, 5 July 2014 at 06:43:31 UTC, Russel Winder via
Digitalmars-d wrote:
All the C++ folk are saying that with C++14 is you are using
any heap at
all you are more than likely doing it wrong. Modern C++ idiom
On Friday, 4 July 2014 at 19:46:40 UTC, Remo wrote:
On Friday, 4 July 2014 at 16:16:35 UTC, Meta wrote:
With @nogc and the -vgc compiler switch, I think it would
fairly easy now to do C-style memory management and know that
there are no hidden GC allocations in your program. Whether
you would
On Friday, 4 July 2014 at 21:15:00 UTC, Chris Cain wrote:
On Friday, 4 July 2014 at 21:09:05 UTC, Remo wrote:
By C++ style memory management I do not mean naked
new/delete or malloc/free.
What I mean is RAII, smart pointers and destructor's.
What is the proper replacement for std::unique_ptr
On Friday, 4 July 2014 at 14:10:29 UTC, bearophile wrote:
D: y u no distinguish between ints/longs/floats/doubles and
pointers when taking out the trash? You argue that internal
pointers make implementing a precise garbage collector (which
wouldn’t mistake numbers for pointers) impossible, but
On Friday, 4 July 2014 at 15:29:06 UTC, Brian Rogoff wrote:
On Friday, 4 July 2014 at 14:10:29 UTC, bearophile wrote:
D: y u no distinguish between ints/longs/floats/doubles and
pointers when taking out the trash? You argue that internal
pointers make implementing a precise garbage collector
On Friday, 4 July 2014 at 16:16:35 UTC, Meta wrote:
On Friday, 4 July 2014 at 15:29:06 UTC, Brian Rogoff wrote:
On Friday, 4 July 2014 at 14:10:29 UTC, bearophile wrote:
D: y u no distinguish between ints/longs/floats/doubles and
pointers when taking out the trash? You argue that internal
On Friday, 4 July 2014 at 19:46:40 UTC, Remo wrote:
Who want to use C-style memory management today ?
How about C++ style memory management, is this easy to this in
D2
now ?
The big problem with that is C++ style memory management
implies we're going to have new/delete which AFAIK delete is
On Friday, 4 July 2014 at 20:25:24 UTC, Chris Cain wrote:
depreciated
deprecated*. I swear I say it correctly and when I'm coding I
type it correctly there XD
On Friday, 4 July 2014 at 20:25:24 UTC, Chris Cain wrote:
On Friday, 4 July 2014 at 19:46:40 UTC, Remo wrote:
Who want to use C-style memory management today ?
How about C++ style memory management, is this easy to this in
D2
now ?
The big problem with that is C++ style memory management
05-Jul-2014 00:25, Chris Cain пишет:
On Friday, 4 July 2014 at 19:46:40 UTC, Remo wrote:
Who want to use C-style memory management today ?
How about C++ style memory management, is this easy to this in D2
now ?
The big problem with that is C++ style memory management implies we're
going to
On Friday, 4 July 2014 at 20:43:01 UTC, Dicebot wrote:
On Friday, 4 July 2014 at 20:25:24 UTC, Chris Cain wrote:
On Friday, 4 July 2014 at 19:46:40 UTC, Remo wrote:
Who want to use C-style memory management today ?
How about C++ style memory management, is this easy to this
in D2
now ?
The
On Friday, 4 July 2014 at 21:09:05 UTC, Remo wrote:
By C++ style memory management I do not mean naked new/delete
or malloc/free.
What I mean is RAII, smart pointers and destructor's.
What is the proper replacement for std::unique_ptr and
std::shared_ptr in D2 ?
Of course with move support
25 matches
Mail list logo