On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
Is there a reason scope(success) needs to set up for exception
handling?
Or is this a bug / potential enhancement ?
If you had no exception handling in place, you'd need to
duplicate code in the output. For instance:
void foo()
{
s
On Sunday, 17 June 2018 at 20:03:09 UTC, aliak wrote:
On Sunday, 17 June 2018 at 02:44:38 UTC, Heromyth wrote:
[...]
I think this bolts.isManifestAssignable [1] will get you
partially there. The place where it'll fail though is a static
immutable (since they are assignable to manifest consta
On Sunday, 17 June 2018 at 02:29:12 UTC, Adam D. Ruppe wrote:
On Saturday, 16 June 2018 at 08:32:38 UTC, DigitalDesigns wrote:
I need to get the protected and private members for
serialization.
This breaks encapsulation.
A better design would be to have a class know how to serialize
itself v
On Sunday, 17 June 2018 at 02:44:38 UTC, Heromyth wrote:
Here is a struct named S:
struct S
{
enum X = 10;
enum Y
{
i = 10
}
enum Z = "str";
struct S {}
class C {}
static int sx = 0;
__gshared int gx = 0;
On Sunday, 17 June 2018 at 12:23:55 UTC, Steven Schveighoffer
wrote:
On 6/17/18 7:07 AM, Vijay Nayar wrote:
This code breaks with the following error:
void main()
{
import std.range;
int[] vals = [];
vals.put(3);
}
/src/phobos/std/range/primitives.d(2328): Attempting to fetch
t
On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
---
// main.d
void main() {
scope(success) {}
}
dmd -betterC main.d
Error: Cannot use try-catch statements with -betterC
---
You can see what the compiler is doing at
https://run.dlang.io/is/5BZOQV and clicking on the "AST
On 6/17/18 8:24 AM, Timoses wrote:
On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
Hello,
I'm not sure whether I'm missing something obvious here, but is there
a reason for scope(success) being lowered to a try-catch statement?
I would have expected only scope(exit) and scope(failure)
On Sunday, 17 June 2018 at 12:10:33 UTC, Nicholas Wilson wrote:
I suspect scope(success) is lowered because scope(exit) and
scope(failure)
are, and that would result in a simpler (compiler)
implementation of it.
does adding nothrow to main fix it? For dcompute I specifically
allow scope(exit|
On 6/17/18 7:07 AM, Vijay Nayar wrote:
This code breaks with the following error:
void main()
{
import std.range;
int[] vals = [];
vals.put(3);
}
/src/phobos/std/range/primitives.d(2328): Attempting to fetch the front
of an empty array of int
The following code has no error:
v
On 6/17/18 6:58 AM, Cauterite wrote:
Hello,
I'm not sure whether I'm missing something obvious here, but is there a
reason for scope(success) being lowered to a try-catch statement?
I would have expected only scope(exit) and scope(failure) to actually
interact with exception handling, while sco
On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
Hello,
I'm not sure whether I'm missing something obvious here, but is
there a reason for scope(success) being lowered to a try-catch
statement?
I would have expected only scope(exit) and scope(failure) to
actually interact with excepti
On 6/16/18 6:23 PM, Jonathan M Davis wrote:
I kind of wish that the forum software discouraged against necro-ing threads
like this, since they're easy for many of us to miss, and once someone
replies to them and brings them to the front of the list in the forum
software, folks tends to reply as i
On Sunday, 17 June 2018 at 10:58:29 UTC, Cauterite wrote:
Hello,
I'm not sure whether I'm missing something obvious here, but is
there a reason for scope(success) being lowered to a try-catch
statement?
I would have expected only scope(exit) and scope(failure) to
actually interact with excepti
This code breaks with the following error:
void main()
{
import std.range;
int[] vals = [];
vals.put(3);
}
/src/phobos/std/range/primitives.d(2328): Attempting to fetch the
front of an empty array of int
The following code has no error:
void main()
{
import std.r
Hello,
I'm not sure whether I'm missing something obvious here, but is
there a reason for scope(success) being lowered to a try-catch
statement?
I would have expected only scope(exit) and scope(failure) to
actually interact with exception handling, while scope(success)
simply places code on th
On Sunday, 17 June 2018 at 04:32:29 UTC, Jonathan M Davis wrote:
On Sunday, June 17, 2018 02:44:38 Heromyth via
Digitalmars-d-learn wrote:
Here is a struct named S:
struct S
{
enum X = 10;
enum Y
{
i = 10
}
enum Z = "str";
struct S {}
class C {}
static int sx = 0;
__gshar
16 matches
Mail list logo