On Wednesday, 2 April 2014 at 22:07:36 UTC, FreeSlave wrote:
Contents of struct are compared field by field using comparison
for the type of each field. Dynamic arrays are compared by
contents. If you want to compare them by pointer use .ptr
property.
opEquals and opCmp are not about hashing,
I have 2 modules:
module A;
public class A {
private static void foo() {}
public static void foo(int) {}
}
module B;
import A;
public class B {
public static void bar() { A.foo(0); }
}
Error: class A.A member foo is not accessible
On Tuesday, April 01, 2014 03:54:07 Jonathan M Davis wrote:
> On Tuesday, April 01, 2014 05:35:28 ed wrote:
> > OK, lazy me just read the std.satetime article again. It appears
> > the design is for no invalid values and it is currently a known
> > limitation due to CTFE.
> >
> > ---
> > d_time_na
Tnx, chcp 65001 and Lucida font out correct string.
On Tuesday, 1 April 2014 at 19:55:05 UTC, Steven Schveighoffer
wrote:
On Tue, 01 Apr 2014 15:47:42 -0400, anonymous
wrote:
Is this bug allready reported? or can somebody who has a
deeper insight to this report it?
I don't know. I think you should report it. If it's already
reported, someon
It says in the Language Reference not to use system and gives
other options. But the other options don't seem to work. I just
have code system("clear");
Contents of struct are compared field by field using comparison
for the type of each field. Dynamic arrays are compared by
contents. If you want to compare them by pointer use .ptr
property.
opEquals and opCmp are not about hashing, I believe. They are
just operators to help when dealing with
It's only server. Maybe problem is on client side.
Try this if you are on Linux:
//Linux C client
#include
#include
#include
#include
#include
#include
#include
int main()
{
int sock, res;
struct sockaddr_in addr;
const char* hello;
size_t len;
sock = socket(AF_INET,
On 2014-04-02 20:48, monarch_dodra wrote:
On Wednesday, 2 April 2014 at 19:54:38 UTC, monarch_dodra wrote:
On Wednesday, 2 April 2014 at 19:02:29 UTC, Simen Kjærås wrote:
Better ideas, please?
--
Simen
I only skimmed through your post, but have you tried taking a look at
adjoin? Preferably,
Thanks,
Actually I'm realizing there's a lot I'm unclear about when it
comes to default comparison, equality, hashing, etc.
If my struct contains a dynamic array, are the contents of the
array compared by default, or just the pointers/lengths?
Also, when two arrays are compared for content,
On Wednesday, 2 April 2014 at 19:54:38 UTC, monarch_dodra wrote:
On Wednesday, 2 April 2014 at 19:02:29 UTC, Simen Kjærås wrote:
Better ideas, please?
--
Simen
I only skimmed through your post, but have you tried taking a
look at adjoin? Preferably, the version in head? Something like
"adj
On Wednesday, 2 April 2014 at 19:33:28 UTC, w0rp wrote:
auto initTuple(size_t N, alias func)() {
string magic() {
string result = "return tuple(";
foreach(i; 0..N) {
result ~= "func(),";
}
result ~= ");";
return result;
}
mixin(m
On Wednesday, 2 April 2014 at 20:14:31 UTC, dnspies wrote:
How can I get the default-hash of a struct I've defined (to be
used as part of the hash for some containing type)?
UserDefined userDefined;
writeln(typeid(UserDefined).getHash(&userDefined));
Probably there is a better way. I don't lik
How can I get the default-hash of a struct I've defined (to be
used as part of the hash for some containing type)?
On Wednesday, 2 April 2014 at 19:02:29 UTC, Simen Kjærås wrote:
Better ideas, please?
--
Simen
I only skimmed through your post, but have you tried taking a
look at adjoin? Preferably, the version in head? Something like
"adjoin!(repeat!(fun, N))" seems to natively do what you are
asking
tuples are definitely a compile-time job. You could do something
like this to build an N tuple by calling a function N many times.
---
import std.typecons;
int foo() {
return 3;
}
auto initTuple(size_t N, alias func)() {
string magic() {
string result = "return tuple(";
I'm trying to create a function that repeats a function call N times.
The exact use case is generating an N-dimensional tuple:
import std.typetuple;
import std.typecons;
template Repeat(size_t n, T...) {
static if (n == 1) {
alias Repeat = T;
} else static if (n) {
alias
Am 02.04.2014 17:57, schrieb Andrea Fontana:
On Wednesday, 2 April 2014 at 15:53:52 UTC, Jacob Carlborg wrote:
On 2014-04-02 17:45, Andrea Fontana wrote:
auto example(char* test) { return toStringz(to!string(test) ~ "
world!"); }
When that return string will be freed?
When there is no refer
On Wednesday, 2 April 2014 at 15:53:52 UTC, Jacob Carlborg wrote:
On 2014-04-02 17:45, Andrea Fontana wrote:
auto example(char* test) { return toStringz(to!string(test) ~
" world!"); }
When that return string will be freed?
When there is no reference left to the string, the garbage
collect
On Wednesday, 2 April 2014 at 15:45:06 UTC, Andrea Fontana wrote:
auto example(char* test) { return toStringz(to!string(test) ~ "
world!"); }
When that return string will be freed?
What about:
extern(C) auto example()
?
to!string allocates on the GC heap when given a char* (it has to
On 2014-04-02 17:45, Andrea Fontana wrote:
auto example(char* test) { return toStringz(to!string(test) ~ " world!"); }
When that return string will be freed?
When there is no reference left to the string, the garbage collector is
free to collect it when it chooses to.
What about:
extern(
auto example(char* test) { return toStringz(to!string(test) ~ "
world!"); }
When that return string will be freed?
What about:
extern(C) auto example()
?
On 2-4-2014 15:38, Denis Mezhov wrote:
On Wednesday, 2 April 2014 at 12:51:57 UTC, bearophile wrote:
Denis Mezhov:
How to out unicode cyrillic string to console?
Try this command on the command line:
chcp 65001
Bye,
bearophile
chcp 65001 dont'work
start.bat
mode con cols=150 lines=50
On Wednesday, 2 April 2014 at 12:51:57 UTC, bearophile wrote:
Denis Mezhov:
How to out unicode cyrillic string to console?
Try this command on the command line:
chcp 65001
Bye,
bearophile
chcp 65001 dont'work
start.bat
mode con cols=150 lines=50
chcp 65001
%Path%\Minesweeper\Debug\Mi.e
Saurabh Das:
I see. I wasn't sure - hence I asked.
https://d.puremagic.com/issues/show_bug.cgi?id=11471
In general, how do I check if this is a known issue?
Search in Bugzilla and/or ask to people.
Bye,
bearophile
I see. I wasn't sure - hence I asked.
In general, how do I check if this is a known issue?
Thanks,
Saurabh
On Wednesday, 2 April 2014 at 11:19:16 UTC, bearophile wrote:
Saurabh Das:
With error:
/usr/include/dmd/druntime/import/core/atomic.d(910): Error:
asm statements are assumed to throw
On Wednesday, 2 April 2014 at 12:47:06 UTC, Denis Mezhov wrote:
I'm trying out to windows console unicode latin string
writeln("aaabbb");
console out: aaabbb
trying out to console unicode cyrillic string
writeln("бббггг");
console out: ╨│╨│╨│╨▒╨▒╨▒
How to out unicode cyrillic string to console
Denis Mezhov:
How to out unicode cyrillic string to console?
Try this command on the command line:
chcp 65001
Bye,
bearophile
I'm trying out to windows console unicode latin string
writeln("aaabbb");
console out: aaabbb
trying out to console unicode cyrillic string
writeln("бббггг");
console out: ╨│╨│╨│╨▒╨▒╨▒
How to out unicode cyrillic string to console?
On Wednesday, 2 April 2014 at 08:55:23 UTC, Russel Winder wrote:
The real signature of main in C/C++ is, I believe:
int main(int, char**, char**)
I believe in C it is:
int main(void)
int main(int,char**)
or implementation defined (e.g. the third env pointer in the main
signature fro
On 4/2/14, Dicebot wrote:
> D main != C main, latter is implemented in D runtime to call the
> former. 0 will be also returned by latter, not the former.
Actually, the compiler injects a return statement in D's main.
It generates the actual C main function (unless WinMain/DllMain is
provided), w
On Wednesday, 2 April 2014 at 08:55:23 UTC, Russel Winder wrote:
On Wed, 2014-04-02 at 00:34 +, bearophile wrote:
Alexandre L.:
> int main(string[] args)
> {
If you don't need args, then I suggest to not put it as main
argument. So probably this is better (note no int nor return,
in D
Russel Winder:
what is the real signature in D?
The _real_ signature of main() is flexible, you can use:
void main()
int main(in string[] args) pure nothrow
D allows you to omit the args if you don't need them, returns 0
if you don't it, and it can be pure/nothrow/@safe as desired.
Perh
Saurabh Das:
With error:
/usr/include/dmd/druntime/import/core/atomic.d(910): Error: asm
statements are assumed to throw
Is there a workaround for this? I have a decent sized codebase
which I wish to profile for hotspots - but it won't compile
with '-profile'.
Isn't this a recent regressi
Hello
For this test program ('test.d'):
import core.atomic;
int func1(shared int a)
{
return atomicLoad(a);
}
These invocations of dmd succeed:
1. dmd -main test.d
2. dmd -main -debug test.d
3. dmd -main -release test.d
But this one fails:
dmd -main -profile test.d
With error:
/usr/includ
On Wednesday, 2 April 2014 at 09:25:53 UTC, Nordlöw wrote:
so happens to support this. So I added your code to the test
cases:
Great!
BTW: Why is static qualifier needed on definition of
minmaxElement() in the unittest?
Whenever you declare something in a nested context, it may or may
not
so happens to support this. So I added your code to the test
cases:
Great!
BTW: Why is static qualifier needed on definition of
minmaxElement() in the unittest?
On Wed, 2014-04-02 at 00:34 +, bearophile wrote:
> Alexandre L.:
> > int main(string[] args)
> > {
>
> If you don't need args, then I suggest to not put it as main
> argument. So probably this is better (note no int nor return, in
> D they are not needed):
>
> void main() {
> ...
> }
I am
38 matches
Mail list logo