On Thursday, 1 December 2016 at 00:36:30 UTC, Jake Pittis wrote:
How do I convert a double to a ubyte[]?
I've tried all sorts of things including converting the double
to a ulong and trying to serialize the ulong. For example test
bellow fails.
unittest {
double d = 3.14;
ulong
On Wednesday, 30 November 2016 at 21:48:20 UTC, Johan Engelen
wrote:
Tip: forget about the `master` branch in your own fork on GH. I
never use it.
Instead, my advice is to locally checkout the master branch
from the repo you want to contribute to (dlang/phobos in your
case).
That works and is
It is my code what caused it after all. How, I do not know yet.
But a similar unittest compiled and passed when I tested with the
master. Anyway, it seems I have no need to make other branches
this time. Thanks for the advice trough. After all, I may need to
rebase anyway when doing the pull re
On Thursday, 1 December 2016 at 01:58:13 UTC, Timothee Cour wrote:
eg:
```
dlib.d:
extern(C) void dfun(){assert(0, "some_msg");}
clib.cpp:
extern "C" void dfun();
void fun(){
try{
dfun();
}
catch(...){
// works but how do i get "some_msg" thrown from D?
}
}
```
portably not su
On Tuesday, 29 November 2016 at 15:56:23 UTC, Jerry wrote:
To avoid having to use the Object class directly you can make
an base class of the class template.
Like:
```
abstract class MyClass {}
abstract class MyClassImpl(T)
{
public:
@property const(T) value(){return _value;}
@property
eg:
```
dlib.d:
extern(C) void dfun(){assert(0, "some_msg");}
clib.cpp:
extern "C" void dfun();
void fun(){
try{
dfun();
}
catch(...){
// works but how do i get "some_msg" thrown from D?
}
}
```
On Thursday, 1 December 2016 at 00:36:30 UTC, Jake Pittis wrote:
How do I convert a double to a ubyte[]?
I've tried all sorts of things including converting the double
to a ulong and trying to serialize the ulong. For example test
bellow fails.
unittest {
double d = 3.14;
ulong
On Thu, Dec 01, 2016 at 12:36:30AM +, Jake Pittis via Digitalmars-d-learn
wrote:
> How do I convert a double to a ubyte[]?
>
> I've tried all sorts of things including converting the double to a
> ulong and trying to serialize the ulong. For example test bellow
> fails.
>
>
> unittest {
On Thursday, 1 December 2016 at 00:36:30 UTC, Jake Pittis wrote:
How do I convert a double to a ubyte[]?
I've tried all sorts of things including converting the double
to a ulong and trying to serialize the ulong. For example test
bellow fails.
unittest {
double d = 3.14;
ulong
How do I convert a double to a ubyte[]?
I've tried all sorts of things including converting the double to
a ulong and trying to serialize the ulong. For example test
bellow fails.
unittest {
double d = 3.14;
ulong l = *cast(ulong*)(&d);
double after = *cast(double*)(&l));
On Wednesday, November 30, 2016 21:48:20 Johan Engelen via Digitalmars-d-
learn wrote:
> Tip: use both a GUI and the commandline. Without SourceTree [1],
> I would be nowhere near as effective with git.
>
> With rebasing, you'll end up having to force push. Force pushing
> is scary (because the rep
On Wednesday, 30 November 2016 at 18:50:42 UTC, Dukc wrote:
On Wednesday, 30 November 2016 at 18:26:32 UTC, Jonathan M
Davis wrote:
[snip]
- Jonathan M Davis
Luckily, I have made a branch for my stuff instead of using
master. But thanks for the help, now I know that it does not
matter where
On Wednesday, 30 November 2016 at 14:53:21 UTC, ag0aep6g wrote:
On 11/30/2016 10:42 AM, Bauss wrote:
Usually casts to base classes can be determined if they're
valid at
compile-time.
Yeah, that's what I said. A cast to a base class is an
"upcast". Upcasts don't need run-time checks. The othe
On Wednesday, November 30, 2016 18:50:42 Dukc via Digitalmars-d-learn wrote:
> On Wednesday, 30 November 2016 at 18:26:32 UTC, Jonathan M Davis
>
> wrote:
> > [snip]
> >
> > - Jonathan M Davis
>
> Luckily, I have made a branch for my stuff instead of using
> master. But thanks for the help, now I k
On Wednesday, 30 November 2016 at 18:26:32 UTC, Jonathan M Davis
wrote:
[snip]
- Jonathan M Davis
Luckily, I have made a branch for my stuff instead of using
master. But thanks for the help, now I know that it does not
matter where I create the other branch for that workaround
because I can
On Wednesday, November 30, 2016 17:14:37 Dukc via Digitalmars-d-learn wrote:
> Well, I was working on std.range.chain (I'm new to contributing),
> and when trying to test locally:
>
> ...\phobos\std\range>rdmd -unittest -main package
> C:\D\dmd2\windows\bin\..\..\src\phobos\std\path.d(1319): Error:
Well, I was working on std.range.chain (I'm new to contributing),
and when trying to test locally:
...\phobos\std\range>rdmd -unittest -main package
C:\D\dmd2\windows\bin\..\..\src\phobos\std\path.d(1319): Error:
pure function 'std.path.buildPath!char.buildPath' cannot call
impure function 'st
On 11/30/2016 10:42 AM, Bauss wrote:
Usually casts to base classes can be determined if they're valid at
compile-time.
Yeah, that's what I said. A cast to a base class is an "upcast". Upcasts
don't need run-time checks. The other direction (cast to more derived
class) is a downcast. Downcasts
On Wednesday, 30 November 2016 at 13:47:06 UTC, Anders S wrote:
On Wednesday, 30 November 2016 at 12:41:24 UTC, Stefan Koch
wrote:
On Wednesday, 30 November 2016 at 10:20:35 UTC, Anders S wrote:
int [1] argv; /* list of arguments */
Is that supposed to be a VLAIS ?
Th
On Wednesday, 30 November 2016 at 12:41:24 UTC, Stefan Koch wrote:
On Wednesday, 30 November 2016 at 10:20:35 UTC, Anders S wrote:
int [1] argv; /* list of arguments */
Is that supposed to be a VLAIS ?
That will not port to D.
It would be helpful If you could share th
On Wednesday, 30 November 2016 at 10:20:35 UTC, Anders S wrote:
int [1] argv; /* list of arguments */
Is that supposed to be a VLAIS ?
That will not port to D.
It would be helpful If you could share the code and state the
intent.
On Wednesday, 30 November 2016 at 07:16:38 UTC, Anders S wrote:
On Tuesday, 29 November 2016 at 23:33:19 UTC, Ali Çehreli wrote:
On 11/29/2016 07:30 AM, Anders S wrote:
Ali
Thanks you all guys, and the cast (IOREQ *) ... did the trick!!
I'll have a look at your other comments aswell on
On Tuesday, 29 November 2016 at 15:56:23 UTC, Jerry wrote:
On Monday, 28 November 2016 at 11:26:41 UTC, dm wrote:
```
abstract class MyClass(T)
{
public:
@property const(T) value(){return _value;}
@property void value(T val){_value = val;}
...
private:
T _value;
...
}
To avoid hav
On Tuesday, 29 November 2016 at 09:58:16 UTC, ag0aep6g wrote:
On 11/29/2016 02:21 AM, Basile B. wrote:
The cast from a class type to a sub class in itself does
absolutely
nothing.
That can't be right. A bad downcast gives you null, so it has
to check the dynamic type information. Compare wit
On Tuesday, 29 November 2016 at 15:01:37 UTC, Anders S wrote:
Thanks guys for a really quick answer !!
OK, a little bit awkward to use but getting there
posting a new question about char * to struct ;)
Thanks
/anders
Also:
import std.conv : text;
string temp = "This is a number";
string greet
25 matches
Mail list logo