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 with upcasts which are statically
known to be correct, so they don
Hi guys,
just started to get into Dlang, comming from C and C++ I like to
use methods like there if possible.
Now I want to catenate something like this, but don't get it to
work
in standard C i code:
char str[80];
sprintf(str, "This is a number = %f", 3.14356);
Now in Dlang and impor
On Tuesday, 29 November 2016 at 10:21:24 UTC, Anders S wrote:
Hi guys,
just started to get into Dlang, comming from C and C++ I like
to use methods like there if possible.
Now I want to catenate something like this, but don't get it to
work
in standard C i code:
char str[80];
sprintf(
I had the following code:
```
import std.algorithm: equal;
struct Data
{
int[3] arr;
}
int main()
{
auto const_data = const(Data)([1, 2, 3]);
assert(const_data.arr[].equal([1, 2, 3]));
Data mutable_data = const_data;
assert(mutable_data.ar
On Tuesday, 29 November 2016 at 10:46:04 UTC, drug wrote:
I had the following code:
```
import std.algorithm: equal;
[...]
You are not calling the (identity) opAssign here, but postblit.
To call identity opAssign, you need an already constructed
instance:
```
Data mutable_data;
mutable_dat
29.11.2016 13:49, Mathias Lang пишет:
On Tuesday, 29 November 2016 at 10:46:04 UTC, drug wrote:
I had the following code:
```
import std.algorithm: equal;
[...]
You are not calling the (identity) opAssign here, but postblit.
To call identity opAssign, you need an already constructed instance
On Tuesday, 29 November 2016 at 10:21:24 UTC, Anders S wrote:
Hi guys,
just started to get into Dlang, comming from C and C++ I like
to use methods like there if possible.
Now I want to catenate something like this, but don't get it to
work
in standard C i code:
char str[80];
sprintf(
On Monday, 21 November 2016 at 18:53:59 UTC, Stefan wrote:
On Monday, 21 November 2016 at 17:26:37 UTC, Jonathan M Davis
wrote:
[...]
Thanks Jonathan for the explanation. The cast works fine but
feels "unsafe".
I will wait for the next version.
Stefan
Version D 2.072.1 Beta fixed my prob
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
Hi guys,
I want to write into a fifo pipe using write( ...)
Now a gather my data into my own struct IOREQ so in order to
write I have to cast into an char buffer.
My problem in dlang is that it doesn't accept the casting (IOREQ
*) I get:
Error: Cannot implicitly convert expression (&sbuf) of
On Tuesday, 29 November 2016 at 15:55:57 UTC, Nemanja Boric wrote:
just
struct IOREQ {
SHORT fc; /* function code */
SHORT rs; /* return code */
INT size; /* size of this request, including */
SHOR
On Tuesday, 29 November 2016 at 15:30:33 UTC, Anders S wrote:
Hi guys,
I want to write into a fifo pipe using write( ...)
Now a gather my data into my own struct IOREQ so in order to
write I have to cast into an char buffer.
My problem in dlang is that it doesn't accept the casting
(IOREQ *)
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 having to use the Object class directly you can make an
base c
On Tuesday, 29 November 2016 at 15:56:23 UTC, Jerry wrote:
abstract class MyClass {}
abstract class MyClassImpl(T)
Oops, forgot MyClassImpl should extend from MyClass.
abstract class MyClassImpl(T) : MyClass {
...
}
On 11/29/2016 07:30 AM, Anders S wrote:
> INTargv[1];/* list of arguments */
In addition to what Nemanja Boric wrote, the recommended array syntax in
D is the following:
INT[1] argv;
> char sbuf[1024];
> io = (IOREQ *)buf; // Not accepted in dlang
You must use t
On Tuesday, 29 November 2016 at 23:33:19 UTC, Ali Çehreli wrote:
On 11/29/2016 07:30 AM, Anders S wrote:
> INTargv[1];/* list of arguments */
Speculation, but given that you say "list of args" is it possible
OP means to use int[0] for an inline array.
In addition to what Ne
On Tuesday, 29 November 2016 at 23:33:19 UTC, Ali Çehreli wrote:
On 11/29/2016 07:30 AM, Anders S wrote:
> INTargv[1];/* list of arguments */
In addition to what Nemanja Boric wrote, the recommended array
syntax in D is the following:
INT[1] argv;
> char sbuf[1024];
>
17 matches
Mail list logo