how to debug memory errors

2016-11-07 Thread Øivind via Digitalmars-d-learn
Hi, My app occasionally gives me a *** Error in `./hauto-test': double free or corruption (fasttop): 0x7f504c002a60 *** but gives me the following on every termination core.exception.InvalidMemoryOperationError@src/core/exception.d(693): Invalid memory operation How do I go about

Re: Variant and immutable struct

2016-08-21 Thread Øivind via Digitalmars-d-learn
On Sunday, 10 January 2016 at 17:50:44 UTC, Vlad Leberstein wrote: As I'm not very good at D, I would like to get some feedback about this solutions' viability. AFAIU memcpy-ing struct here is safe because all target arguments ever passed to tryPutting are internal to implementation(and

Re: static init of associative array of enums not working.. why?

2016-02-26 Thread Øivind via Digitalmars-d-learn
On Saturday, 27 February 2016 at 04:35:41 UTC, Adam D. Ruppe wrote: It just isn't implemented in the compiler. Instead, you can declare it outside and set it in a static module constructor: That was quick! Thank you. Should I file a ticket for this?

static init of associative array of enums not working.. why?

2016-02-26 Thread Øivind via Digitalmars-d-learn
Shouldn't this work? According to "Static Initialization of AAs" on this page, it should: https://dlang.org/spec/hash-map.html enum DevicePropDataType { dString, dDateTime } enum DevicePropValType { property, miscDate } immutable DevicePropDataType[DevicePropValType] propDType = [

version in enum

2016-01-09 Thread Øivind via Digitalmars-d-learn
Hi, Why doesn't this work? Seems like it should: enum { A = 1, version(xx) { B = 2 } } void main() { } Compilation output: /d732/f174.d(5): Error: basic type expected, not version /d732/f174.d(5): Error: no identifier for declarator int