I am trying to compile the following code using:
dmd test.d
or
dmd test.d shell32.lib
import std.c.windows.windows;
int main(string[] args) {
extern (Windows) HINSTANCE ShellExecuteW(HWND, LPCWSTR, LPCWSTR,
LPCWSTR, LPCWSTR, INT);
HINSTANCE i = ShellExecuteW(null, "open",
"http://www
Daniel Worthington wrote:
import std.c.windows.windows;
int main(string[] args) {
extern (Windows) HINSTANCE ShellExecuteW(HWND, LPCWSTR, LPCWSTR,
LPCWSTR, LPCWSTR, INT);
HINSTANCE i = ShellExecuteW(null, "open",
"http://www.example.com";, null, null, SW_SHOW);
return 0;
}
Err
Hi, I'm trying to sort an array of strings exactly the way it's done in
the docs, but I don't get the expected results:
import std.algorithm;
import std.stdio;
import std.contracts;
void main()
{
string[] arr = ["unions", "vars", "d_enum", "constructors",
On Wednesday 04 August 2010 02:17:31 Johannes Pfau wrote:
> Hi, I'm trying to sort an array of strings exactly the way it's done in
> the docs, but I don't get the expected results:
>
>
> import std.algorithm;
> import std.stdio;
> import std.contracts;
>
> void main(
Hi,
The code below is my beginning to attempt a class which implements any class
and throws an exception if one tries to access any member of that class.
Problem is that if I use:
auto a1 = noinit!(A)();
it works and accesses the int x() {...} member of the generated class, but
if I use:
A a1 =
Am 04.08.2010 12:11, schrieb Rory Mcguire:
Hi,
The code below is my beginning to attempt a class which implements any class
and throws an exception if one tries to access any member of that class.
Problem is that if I use:
auto a1 = noinit!(A)();
it works and accesses the int x() {...} member
On Tue, 03 Aug 2010 21:04:26 -0400, Sam Hu wrote:
Richard Webb Wrote:
The Juno library has a 'uuid' that works like that, and the posted
example seems
to build ok here using DMD 1.062.
Theres also a Tango version of the same code in the dwin library, but i
haven't
tried that for ages.
T
Dwin uses Tango and so only works in D1 anyway, so i don't know if thats the
problem (Juno uses string already, and i've used that ok in D1 and D2).
I've managed to get Juno working with a recent D2 before, but with the latest
SVN
version i get:
///
ph
On Wed, 04 Aug 2010 08:35:18 -0400, Richard Webb
wrote:
Dwin uses Tango and so only works in D1 anyway, so i don't know if thats
the
problem (Juno uses string already, and i've used that ok in D1 and D2).
All I'm saying is that is what the error message is saying "you're trying
to mixin
Hi,
I am experienced in C++ but still a relative D newbie...
I am building a static lib containing a bunch of functions that I often
re-use. I will use these in other exe/dll projects by linking to the lib [and
specifying the necessary Import paths..].
Everything is working ok when I test the co
On Wed, 04 Aug 2010 12:50:45 +, Ettienne Gilbert wrote:
> I have even - in desperation [did not really think it would work] -
> tried to pass "--main" as an argument to the compiler [described by
> Andrei in "The D Programming Language" in $5.1 on p133], in the hope
> that I can fool the comp
Ettienne Gilbert wrote:
Hi,
I am experienced in C++ but still a relative D newbie...
I am building a static lib containing a bunch of functions that I often
re-use. I will use these in other exe/dll projects by linking to the lib [and
specifying the necessary Import paths..].
Everything is wor
Mafi wrote:
> Am 04.08.2010 12:11, schrieb Rory Mcguire:
>> Hi,
>>
>> The code below is my beginning to attempt a class which implements any
>> class and throws an exception if one tries to access any member of that
>> class.
>>
>> Problem is that if I use:
>> auto a1 = noinit!(A)();
>>
>> it work
Thats what feels weird to me. a.x can result in different things happening
even though x exists in both A and the generated class. However the
generated class has two "fields" called x one you can't access anymore and
the @property one.
When I create an instance of the generated class I would expe
04.08.2010 14:11, Rory Mcguire wrote:
Hi,
The code below is my beginning to attempt a class which implements any class
and throws an exception if one tries to access any member of that class.
Problem is that if I use:
auto a1 = noinit!(A)();
it works and accesses the int x() {...} member of t
Mafi wrote:
>> Thats what feels weird to me. a.x can result in different things
>> happening even though x exists in both A and the generated class. However
>> the generated class has two "fields" called x one you can't access
>> anymore and the @property one.
>> When I create an instance of the g
On Wed, Aug 4, 2010 at 14:48, Steven Schveighoffer wrote:
> On Wed, 04 Aug 2010 08:35:18 -0400, Richard Webb
> wrote:
>
> I haven't worked out whats causing the problem yet, though looking at
> the Phobos
>
>> code i'm not sure what the
>>
>> is(char[1 + Range.empty]))
>>
>
> Not sure
struct bar( T ) {
auto baz( U )( U arg ) {
bar!( typeof( this ) ) tmp;
return tmp;
}
}
void main( ) {
bar!int n;
n.baz( 3 );
}
This code fails with
Error: recursive template expansion for template argument bar!(int)
Now, I agree it is recursive, but it is not infi
On Wed, 04 Aug 2010 14:52:14 -0400, Philippe Sigaud
wrote:
On Wed, Aug 4, 2010 at 14:48, Steven Schveighoffer
wrote:
On Wed, 04 Aug 2010 08:35:18 -0400, Richard Webb
wrote:
I haven't worked out whats causing the problem yet, though looking
at
the Phobos
code i'm not sure w
On Wed, 04 Aug 2010 15:37:32 -0400, Simen kjaeraas
wrote:
struct bar( T ) {
auto baz( U )( U arg ) {
bar!( typeof( this ) ) tmp;
return tmp;
}
}
void main( ) {
bar!int n;
n.baz( 3 );
}
This code fails with
Error: recursive template expansion for templat
I don't have a minimal example, but i have found that the error only occurs with
the most recent version of std.algorithm -> the current SVN version of phobos
with
the previous revision of algorithm compiles ok.
Steven Schveighoffer wrote:
On Wed, 04 Aug 2010 15:37:32 -0400, Simen kjaeraas
wrote:
struct bar( T ) {
auto baz( U )( U arg ) {
bar!( typeof( this ) ) tmp;
return tmp;
}
}
void main( ) {
bar!int n;
n.baz( 3 );
}
This code fails with
Error: recursive
On Wed, Aug 4, 2010 at 22:06, Steven Schveighoffer wrote:
> On Wed, 04 Aug 2010 15:37:32 -0400, Simen kjaeraas
> wrote:
>
> struct bar( T ) {
>> auto baz( U )( U arg ) {
>> bar!( typeof( this ) ) tmp;
>> return tmp;
>> }
>> }
>>
>> void main( ) {
>> bar!int n;
>>
On Wed, Aug 4, 2010 at 22:00, Steven Schveighoffer wrote:
>
code i'm not sure what the
is(char[1 + Range.empty]))
>>>
>>> Hm..., then shouldn't that be is(typeof(...))?
>
>
But char[1 + ...] is already a type, no? I thought typeof() was to extract
type from an express
On Wed, 04 Aug 2010 17:31:30 -0400, Philippe Sigaud
wrote:
On Wed, Aug 4, 2010 at 22:00, Steven Schveighoffer
wrote:
code i'm not sure what the
is(char[1 + Range.empty]))
Hm..., then shouldn't that be is(typeof(...))?
But char[1 + ...] is already a type, no? I thought typeo
How can I tell that S1 and S2 are different instantiations of the same struct
template, while Bar is an instantiation of a different struct template?
struct Foo(T...) {}
struct Bar(T...) {}
template SameStructTemplate(S1, S2) {
// enum bool SameStructTemplate = ?
}
void main() {
alias
Something simpler is enough for my purposes, to tell that a type is one
instantiation of Foo or not:
struct Foo(T...) {}
struct Bar(T...) {}
template IsFoo(S) {
// ?
}
void main() {
alias Foo!(int,int,int) S1;
alias Foo!(float,int,int,int) S2;
alias Bar!(float,int,int,int) S3;
I have found one bad looking solution :-)
template IsFoo(alias S) {
enum bool IsFoo = __traits(compiles, { void isf(T...)(Foo!T){} isf(S.init);
});
}
Bye,
bearophile
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=114518
Is there a way to report a custom error message for unsupported template
instantiations?
Hello Kagamin,
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmar
s.D&article_id=114518
Is there a way to report a custom error message for unsupported
template instantiations?
template Foo(T)
{
static assert(Chcek!(T), "message");
...
}
template Bar(T) if (is( T ==
On Thu, Aug 5, 2010 at 04:26, bearophile wrote:
> I have found one bad looking solution :-)
>
> template IsFoo(alias S) {
>enum bool IsFoo = __traits(compiles, { void isf(T...)(Foo!T){}
> isf(S.init); });
> }
>
I used to be confronted to this pb too. Here is what I did:
/**
Alias itself to
31 matches
Mail list logo