On Saturday, 20 June 2015 at 01:50:11 UTC, Yuxuan Shui wrote:
Try to compile this code snippet:
import std.traits;
template a(R) {
auto a(S)(auto ref R i) {
return cast(S)i*2;
}
}
template ReturnTypeEx(alias A, B) {
alias ReturnTypeEx = ReturnType!(A!B);
}
Try to compile this code snippet:
import std.traits;
template a(R) {
auto a(S)(auto ref R i) {
return cast(S)i*2;
}
}
template ReturnTypeEx(alias A, B) {
alias ReturnTypeEx = ReturnType!(A!B);
}
template b(alias R) {
int b(S)(S i) {
nice read, thank you
On Wednesday, 17 June 2015 at 18:35:36 UTC, Laeeth Isharc wrote:
Hi.
I know D has support for COM - not sure of its status. And
there was a Microsoft chap who posted here a couple of years
back - wonderful templated code that made it easy to write this
kind of thing. Unfortunately he wasn't
http://www.nytimes.com/2015/06/21/opinion/sunday/is-your-boss-mean.html?_r=0
Off topic, but perhaps of interest.
Laeeth.
On 6/19/15 12:09 PM, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 14:42:59 UTC, Steven Schveighoffer wrote:
On 6/19/15 10:13 AM, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 14:04:05 UTC, Daniel Kozák wrote:
On Fri, 19 Jun 2015 13:52:52 +
Quentin Ladeveze via Digitalmars-d-lea
On Friday, 19 June 2015 at 19:10:11 UTC, Shachar Shemesh wrote:
On 14/06/15 04:31, Adam D. Ruppe wrote:
On Sunday, 14 June 2015 at 00:52:20 UTC, FujiBar wrote:
I have read that in D structs are always allocated on the
stack while
classes are always allocated on the heap.
That's not true; it
On 14/06/15 04:31, Adam D. Ruppe wrote:
On Sunday, 14 June 2015 at 00:52:20 UTC, FujiBar wrote:
I have read that in D structs are always allocated on the stack while
classes are always allocated on the heap.
That's not true; it is a really common misconception.
Putting a struct on the heap is
On Friday, 19 June 2015 at 15:47:09 UTC, ZombineDev wrote:
On Friday, 19 June 2015 at 14:13:46 UTC, Quentin Ladeveze wrote:
[..]
These are interesting and can be useful, but allMembers
returns strings and not functions, so I can't apply ReturnType.
Here's my solution:
http://dpaste.dzfl.pl/c6
On Friday, 19 June 2015 at 15:36:54 UTC, Justin Whear wrote:
On Fri, 19 Jun 2015 13:27:13 +, Quentin Ladeveze wrote:
Is there any way to have a asTuple method in this struct that
would returns something like :
Tuple!(int, "a", float, "b", string, "c")
and that will contain the values of
On Friday, 19 June 2015 at 14:42:59 UTC, Steven Schveighoffer
wrote:
On 6/19/15 10:13 AM, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 14:04:05 UTC, Daniel Kozák wrote:
On Fri, 19 Jun 2015 13:52:52 +
Quentin Ladeveze via Digitalmars-d-learn
wrote:
On Friday, 19 June 2015 at 13:38:4
On Friday, 19 June 2015 at 14:13:46 UTC, Quentin Ladeveze wrote:
[..]
These are interesting and can be useful, but allMembers returns
strings and not functions, so I can't apply ReturnType.
Here's my solution:
http://dpaste.dzfl.pl/c69de3c16d75
On Fri, 19 Jun 2015 13:27:13 +, Quentin Ladeveze wrote:
>
> Is there any way to have a asTuple method in this struct that would
> returns something like :
>
> Tuple!(int, "a", float, "b", string, "c")
>
> and that will contain the values of the methods of the struct ?
>
> Thanks.
You'll wa
On 6/19/15 10:13 AM, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 14:04:05 UTC, Daniel Kozák wrote:
On Fri, 19 Jun 2015 13:52:52 +
Quentin Ladeveze via Digitalmars-d-learn
wrote:
On Friday, 19 June 2015 at 13:38:45 UTC, Steven Schveighoffer wrote:
>
> Does this work for you, or is
On 6/19/15 10:01 AM, Baz wrote:
On Friday, 19 June 2015 at 13:52:54 UTC, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 13:38:45 UTC, Steven Schveighoffer wrote:
Does this work for you, or is there a further expectation?
auto asTuple() { return Tuple!(int, "a", ...)(a, b, stringValue);}
On Friday, 19 June 2015 at 14:04:05 UTC, Daniel Kozák wrote:
On Fri, 19 Jun 2015 13:52:52 +
Quentin Ladeveze via Digitalmars-d-learn
wrote:
On Friday, 19 June 2015 at 13:38:45 UTC, Steven Schveighoffer
wrote:
>
> Does this work for you, or is there a further expectation?
>
> auto asTuple
On Friday, 19 June 2015 at 13:52:54 UTC, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 13:38:45 UTC, Steven Schveighoffer
wrote:
Does this work for you, or is there a further expectation?
auto asTuple() { return Tuple!(int, "a", ...)(a, b,
stringValue);}
-Steve
In fact, I was trying
On Fri, 19 Jun 2015 13:52:52 +
Quentin Ladeveze via Digitalmars-d-learn
wrote:
> On Friday, 19 June 2015 at 13:38:45 UTC, Steven Schveighoffer
> wrote:
> >
> > Does this work for you, or is there a further expectation?
> >
> > auto asTuple() { return Tuple!(int, "a", ...)(a, b,
> > stringV
On Friday, 19 June 2015 at 13:38:45 UTC, Steven Schveighoffer
wrote:
Does this work for you, or is there a further expectation?
auto asTuple() { return Tuple!(int, "a", ...)(a, b,
stringValue);}
-Steve
In fact, I was trying to use traits to create the tuple
automatically and being able to
On Friday, 19 June 2015 at 13:40:01 UTC, Baz wrote:
On Friday, 19 June 2015 at 13:27:15 UTC, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 13:26:03 UTC, Steven Schveighoffer
wrote:
[...]
Thank you :)
Here is th corrected version :
Hi,
I have a struct with some methods int it, let's
On 6/19/15 9:27 AM, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 13:26:03 UTC, Steven Schveighoffer wrote:
On 6/19/15 9:13 AM, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 13:12:08 UTC, Quentin Ladeveze wrote:
Hi,
I have a struct with some methods int it, let's say
```
struct E
On Friday, 19 June 2015 at 13:27:15 UTC, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 13:26:03 UTC, Steven Schveighoffer
wrote:
On 6/19/15 9:13 AM, Quentin Ladeveze wrote:
[...]
You can't. The forum is backed by a newsgroup, just post the
full corrected version :)
-Steve
Thank you
On Friday, 19 June 2015 at 13:26:03 UTC, Steven Schveighoffer
wrote:
On 6/19/15 9:13 AM, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 13:12:08 UTC, Quentin Ladeveze
wrote:
Hi,
I have a struct with some methods int it, let's say
```
struct Example{
int intValue(){
Hum. How can I d
On 6/19/15 9:13 AM, Quentin Ladeveze wrote:
On Friday, 19 June 2015 at 13:12:08 UTC, Quentin Ladeveze wrote:
Hi,
I have a struct with some methods int it, let's say
```
struct Example{
int intValue(){
Hum. How can I delete a post ?
You can't. The forum is backed by a newsgroup, just p
Hi,
I have a struct with some methods int it, let's say
```
struct Example{
int intValue(){
On Friday, 19 June 2015 at 13:12:08 UTC, Quentin Ladeveze wrote:
Hi,
I have a struct with some methods int it, let's say
```
struct Example{
int intValue(){
Hum. How can I delete a post ?
On Thursday, 18 June 2015 at 11:36:50 UTC, Arjan wrote:
See the 'COM in plain C' articles by Jeff Glatt which
demonstrate how to do it using C. This might give you the
information needed to do it using D.
http://www.codeproject.com/Articles/Jeff-Glatt#articles.
It's a little misleading though
27 matches
Mail list logo