On Sunday, 26 March 2017 at 23:25:49 UTC, XavierAP wrote:
I've looked into Phobos to emulate it when defining my own
trait template, and when I see this:
module std.range.primitives;
// ...
template isInputRange(R)
{
enum bool isInputRange = is(typeof(
(inout int = 0)
{
R r
I came back to this project and realised my mistakes (Importer is
a class for the C++ API, and we're using the C API).
So I fixed all my errors, but now I get an access violation.
As far as I can tell, it seems to be an issue with
`aiGetMaterialTexture`. It is meant to return an aiString with
On Sunday, 26 March 2017 at 02:41:46 UTC, Adam D. Ruppe wrote:
On Sunday, 26 March 2017 at 02:24:56 UTC, Jolly James wrote:
You can ignore the loop()-method. It is not called as the
application will never reach this statement, because it
cannot, because it crashes already in the
On 03/26/2017 11:31 PM, Dlearner wrote:
SDL_Surface* surface = IMG_Load(filename.ptr);
if (surface is null) {
writeln("surface is null: ", to!string(IMG_GetError()));
} else {
writeln(filename);
}
From console:
surface is null: Couldn't open
On Sunday, 26 March 2017 at 20:58:24 UTC, Adam D. Ruppe wrote:
Module declarations are only optional in the most trivial case
that is rarely useful in real world code. I recommend you
ALWAYS use them (and always put a ddoc comment on them!), and
moreover that you avoid top name modules (use
On Sunday, March 26, 2017 20:51:01 XavierAP via Digitalmars-d-learn wrote:
> I've perused both the spec[1] and Andrei's book, and I the idea I
> get is that module declarations are optional, recommended only in
> case of file names not being valid D names. But in the community
> (and Phobos) I see
On Sunday, 26 March 2017 at 12:40:42 UTC, Dlearner wrote:
...
About half the textures seem to load fine. Some progress!
I don't know why, but when I get to the 8th texture, the filename
has some garbage attached.
SDL_Surface* surface = IMG_Load(filename.ptr);
if (surface is null) {
On Sunday, 26 March 2017 at 18:50:13 UTC, bauss wrote:
On Sunday, 26 March 2017 at 11:46:39 UTC, Jolly James wrote:
[...]
Chances are it's invoked in another thread and thus you can't
catch it like that.
To sum it up.
Ex.
void thisFunctionThrows() { ... }
void ableToCatch() {
try {
On Sunday, 26 March 2017 at 22:10:07 UTC, XavierAP wrote:
I was curious but I guess it's long to explain the different
things that can go wrong if one doesn't declare module names.
You'll just get a name conflict eventually. Either two modules
with the same name, or "module `foo` must be
I've looked into Phobos to emulate it when defining my own trait
template, and when I see this:
module std.range.primitives;
// ...
template isInputRange(R)
{
enum bool isInputRange = is(typeof(
(inout int = 0)
{
R r = R.init; // can define a range object
if
What's the difference between
1.
string x = "abcd";
foreach(character; x)
write(character);
and
string x = "abcd";
foreach(character; x[0..$])
write(character);
2. is and ==
3. pointer and address and reference?
On Sunday, 26 March 2017 at 06:45:13 UTC, ketmar wrote:
yes. you have a typo in second `writefln`: S1 instead of S2. ;-)
thank you.
another question, related to my first post:
why size of S2.b1 and S2.b2 still 3, not 4?
am i right: then align applied to members, compiler not change
size of
On Sunday, 26 March 2017 at 11:46:39 UTC, Jolly James wrote:
On Sunday, 26 March 2017 at 11:35:00 UTC, Jolly James wrote:
[...]
Found out something: You cannot catch any exception thrown in
the listen()-method in general.
■ Original code:
[...]
■ Modified one:
[...]
■ Not working
On Sunday, 26 March 2017 at 20:51:01 UTC, XavierAP wrote:
I've perused both the spec[1] and Andrei's book, and I the idea
I get is that module declarations are optional, recommended
only in case of file names not being valid D names.
Module declarations are only optional in the most trivial
I've perused both the spec[1] and Andrei's book, and I the idea I
get is that module declarations are optional, recommended only in
case of file names not being valid D names. But in the community
(and Phobos) I see it's strongly recommended and used throughout.
What's the reason? If the
zabruk70 wrote:
On Sunday, 26 March 2017 at 06:45:13 UTC, ketmar wrote:
yes. you have a typo in second `writefln`: S1 instead of S2. ;-)
thank you.
another question, related to my first post:
why size of S2.b1 and S2.b2 still 3, not 4?
am i right: then align applied to members, compiler
On Sunday, 26 March 2017 at 11:35:00 UTC, Jolly James wrote:
On Sunday, 26 March 2017 at 02:41:46 UTC, Adam D. Ruppe wrote:
On Sunday, 26 March 2017 at 02:24:56 UTC, Jolly James wrote:
You can ignore the loop()-method. It is not called as the
application will never reach this statement,
On Sunday, 26 March 2017 at 11:10:55 UTC, ag0aep6g wrote:
On Sunday, 26 March 2017 at 10:34:21 UTC, Dlearner wrote:
I came back to this project and realised my mistakes (Importer
is a class for the C++ API, and we're using the C API).
So I fixed all my errors, but now I get an access
zabruk70 wrote:
On Sunday, 26 March 2017 at 05:09:15 UTC, ketmar wrote:
most of the time either location or padding will work the same.
hmm.. you ruined my expirence..
i made another experiment.
whould you please explain me S2 size 6?
thank you for you time.
yes. you have a typo in second
On Sunday, 26 March 2017 at 06:38:59 UTC, zabruk70 wrote:
oh sorry sorry - mistyping
ok. DMD use padding, so for real container.sizeof
i should use lastMemeber.offsetof+lastMemeber.sizeof
On Sunday, 26 March 2017 at 10:34:21 UTC, Dlearner wrote:
I came back to this project and realised my mistakes (Importer
is a class for the C++ API, and we're using the C API).
So I fixed all my errors, but now I get an access violation.
As far as I can tell, it seems to be an issue with
On Sunday, 26 March 2017 at 05:09:15 UTC, ketmar wrote:
most of the time either location or padding will work the same.
hmm.. you ruined my expirence..
i made another experiment.
whould you please explain me S2 size 6?
thank you for you time.
https://dpaste.dzfl.pl/9a31b6e370a0
struct S1
On Sunday, 26 March 2017 at 07:18:14 UTC, ketmar wrote:
i.e. what compiler does (roughly) is inserting anonymous fields
of the appropriate size *into* the container. for "inner"
aligning compiler inserts anonymous fields *between* other
fields. for "outer" aligning compiler just appends
On 26/03/2017 7:52 AM, helxi wrote:
What's the difference between
1.
string x = "abcd";
foreach(character; x)
write(character);
and
string x = "abcd";
foreach(character; x[0..$])
write(character);
Hopefully the compiler is smart enough to ignore that slice (since its
On Wednesday, 1 March 2017 at 20:23:57 UTC, aberba wrote:
On Friday, 24 February 2017 at 22:44:55 UTC, XavierAP wrote:
[...]
Gtkd is obviously defacto for Linux ONLY, dlangui for cross
platform app without native feel. But if you want something
easy and flexible with native look and feel on
25 matches
Mail list logo