On Saturday, September 24, 2011 01:05:52 Jerry Quinn wrote:
> Jonathan M Davis Wrote:
> > On Friday, September 23, 2011 23:01:17 Jerry Quinn wrote:
> >
> > A direct rewrite would involve using shared and synchronized (either on
> > the class or a synchronized block around the code that you want to
Jonathan M Davis Wrote:
> On Friday, September 23, 2011 23:01:17 Jerry Quinn wrote:
>
> A direct rewrite would involve using shared and synchronized (either on the
> class or a synchronized block around the code that you want to lock).
> However,
> the more idiomatic way to do it would be to u
On Friday, September 23, 2011 23:01:17 Jerry Quinn wrote:
> Hi folks,
>
> I wasn't sure whether this should go here or in the D devel list...
>
> I'm trying to port a program where threads read from a file, process the
> data, then write the output data. The program is cpu-bound. In C++ I can
>
Hi folks,
I wasn't sure whether this should go here or in the D devel list...
I'm trying to port a program where threads read from a file, process the data,
then write the output data. The program is cpu-bound. In C++ I can do
something like this:
class QueueIn {
ifstream in;
mutex m;
O... So I if it is in my main function (which I think it is) I should move
it
out? That makes sense... Thank you Timon!!
On Fri, 23 Sep 2011 23:44:41 +0300, Jonathan M Davis
wrote:
It uses the const version if the struct or class is const. And in
neither case
in your program is it const. It's mutable in both, so the mutable
overload is
the one that gets called in both places. Why would the const version get
On Fri, 23 Sep 2011 23:44:52 +0300, Steven Schveighoffer
wrote:
steves@steve-laptop:~/testd$ cat testconst.cpp
#include
using namespace std;
struct S {
S& fun() {
cout << "fun" << endl;
return *this;
}
S fun() const {
cout << "fun const" << endl;
On Fri, 23 Sep 2011 16:35:59 -0400, so wrote:
On Fri, 23 Sep 2011 23:27:02 +0300, Jonathan M Davis
wrote:
On Friday, September 23, 2011 23:19:15 so wrote:
Hello everyone.
I asked this a few times with no response.
Could anyone explain me what is the rational behind this?
Why it won't dis
On Fri, 23 Sep 2011 16:27:23 -0400, Steven Schveighoffer
wrote:
On Fri, 23 Sep 2011 16:19:15 -0400, so wrote:
Hello everyone.
I asked this a few times with no response.
Could anyone explain me what is the rational behind this?
Why it won't distinguish mutable overload from immutable as in
On Friday, September 23, 2011 23:35:59 so wrote:
> On Fri, 23 Sep 2011 23:27:02 +0300, Jonathan M Davis
>
> wrote:
> > On Friday, September 23, 2011 23:19:15 so wrote:
> >> Hello everyone.
> >>
> >> I asked this a few times with no response.
> >> Could anyone explain me what is the rational behi
On Fri, 23 Sep 2011 23:27:02 +0300, Jonathan M Davis
wrote:
On Friday, September 23, 2011 23:19:15 so wrote:
Hello everyone.
I asked this a few times with no response.
Could anyone explain me what is the rational behind this?
Why it won't distinguish mutable overload from immutable as in C+
On Friday, September 23, 2011 13:29:08 Jonathan Crapuchettes wrote:
> I'm working on an application that requires a large number of strings that
> only need to be loaded once at runtime and need to be accessible to all
> threads throughout the execution of the program. Some of these strings are
> v
I'm working on an application that requires a large number of strings that only
need to be loaded once at runtime and need to be accessible to all threads
throughout the execution of the program. Some of these strings are variables
like database host and username that need to be read from a file
On Fri, 23 Sep 2011 16:19:15 -0400, so wrote:
Hello everyone.
I asked this a few times with no response.
Could anyone explain me what is the rational behind this?
Why it won't distinguish mutable overload from immutable as in C++?
example? I'm afraid I don't really understand the question.
On Friday, September 23, 2011 23:19:15 so wrote:
> Hello everyone.
>
> I asked this a few times with no response.
> Could anyone explain me what is the rational behind this?
> Why it won't distinguish mutable overload from immutable as in C++?
That compiles fine with the lastest dmd from git. Is
Hello everyone.
I asked this a few times with no response.
Could anyone explain me what is the rational behind this?
Why it won't distinguish mutable overload from immutable as in C++?
test2.d
Description: Binary data
On Friday, September 23, 2011 01:38 Tobias Pankrath wrote:
> > If immutable cannot be used, what else can be used to replace #define
> > in C?
> >
> > Thanks a lot.
>
> immutables are runtime constants. For case you need a
> compile time constant, which you can define with enum.
>
> enum string
On Thu, 22 Sep 2011 22:18:29 +0100, Jonathan M Davis
wrote:
On Thursday, September 22, 2011 14:10 Steven Schveighoffer wrote:
No, the parameter types can be const, and can accept mutable arguments.
The main point is, the return value has to be proven to be *unique*. The
only way to do this wit
"Jesse Phillips" wrote in message
news:j5gfsa$2d5g$1...@digitalmars.com...
> Thank you this lets it compile. I think I had that somewhere, but forgot
> about it. As Steve mentions, it probably should also work for const
> arguments too.
It probably will, eventually. Some expressions can be pr
Thank you all very much.
Paolo
On Sep 22, 2011, at 7:12 PM, Jonathan M Davis wrote:
> On Thursday, September 22, 2011 04:12 Paolo Invernizzi wrote:
>
> The error is a bit confusing but essentially correct. Bar has an immutable
> member variable. Once it's been initialized, that immutable member
> If immutable cannot be used, what else can be used to replace #define
> in C?
>
> Thanks a lot.
immutables are runtime constants. For case you need a
compile time constant, which you can define with enum.
enum string mycase = "value";
import std.stdio;
immutable HELLO = "hello";
void main() {
auto string = "hello";
switch(string) {
case HELLO:
writeln("hello");
break;
default:
writeln("unknown");
break;
}
}
testCase.d(7): Error: case mus
Paolo Invernizzi , dans le message (digitalmars.D.learn:29680), a
écrit :
>
> --Apple-Mail-7--919646864
> Content-Transfer-Encoding: quoted-printable
> Content-Type: text/plain;
> charset=us-ascii
>
> Hi all,=20
>
> I've found nothing on bugzilla for that, what I'm missing? Or it's a =
>
23 matches
Mail list logo