Re: Do a class invariants affect -release builds?

2015-12-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/6/15 6:01 PM, Andrew LaChance wrote: On Saturday, 5 December 2015 at 23:27:31 UTC, Steven Schveighoffer wrote: On 12/5/15 6:06 PM, Andrew LaChance wrote: I was reading a blog post here: http://3d.benjamin-thaut.de/?p=20 which mentions: "Calls to the druntime invariant handler are

Re: Do a class invariants affect -release builds?

2015-12-06 Thread Andrew LaChance via Digitalmars-d-learn
On Saturday, 5 December 2015 at 23:27:31 UTC, Steven Schveighoffer wrote: On 12/5/15 6:06 PM, Andrew LaChance wrote: I was reading a blog post here: http://3d.benjamin-thaut.de/?p=20 which mentions: "Calls to the druntime invariant handler are emitted in release build also and there is no

Do a class invariants affect -release builds?

2015-12-05 Thread Andrew LaChance via Digitalmars-d-learn
I was reading a blog post here: http://3d.benjamin-thaut.de/?p=20 which mentions: "Calls to the druntime invariant handler are emitted in release build also and there is no way to turn them off. Even if the class does not have any invariants the invariant handler will always be called, walk

Re: Do a class invariants affect -release builds?

2015-12-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/5/15 6:06 PM, Andrew LaChance wrote: I was reading a blog post here: http://3d.benjamin-thaut.de/?p=20 which mentions: "Calls to the druntime invariant handler are emitted in release build also and there is no way to turn them off. Even if the class does not have any invariants the

Re: Do a class invariants affect -release builds?

2015-12-05 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/5/15 6:54 PM, Chris Wright wrote: I've never used a release build of anything. Bounds checking isn't that expensive. void main() { int[] arr = new int[10]; assert(arr.capacity == 1000); // obviously wrong arr[10] = 5; } dmd -release -boundscheck=on testboundscheck.d

Re: Do a class invariants affect -release builds?

2015-12-05 Thread Chris Wright via Digitalmars-d-learn
On Sat, 05 Dec 2015 23:06:22 +, Andrew LaChance wrote: > I was reading a blog post here: http://3d.benjamin-thaut.de/?p=20 which > mentions: > > "Calls to the druntime invariant handler are emitted in release build > also and there is no way to turn them off. Even if the class does not >