Hi,I got the right answer in vibe.d forum,here is the link:
http://forum.rejectedsoftware.com/groups/rejectedsoftware.vibed/thread/24403/#post-24416
Ola Fosheim Grøstad:
D claims to follow C, so using unions for type punning is
ultimately implementation defined.
I am not sure if D is the same as C regarding this.
Bye,
bearophile
Hi,
I can't figure this out.
struct Pair(T)
{
T x;
T y;
alias x c;
alias y r;
}
What would like is that the x and y to be initialized to
different values depending on type eg:
struct Container
{
Pair!double sample1; // This will initialize sample1 with 0 for
both x and y
On 2015-03-06 at 00:25, ketmar wrote:
unicode sux[1].
[1] http://file.bestmx.net/ee/articles/uni_vs_code.pdf
Great article. Thanks, Кетмар
⚠ ∑ ♫ ⚽ ☀ ☕ ☺ ≡ ♛
TCPConnecion has a read method, which will block untill the buf
is fully filled.
This is not what I want.
I want a readSome method, which will return if some data comes
from remote end, and notify the length of data to me. so I can
process data in time.
what should I do ?
There should be a function called DataAvilable.
Simply read the data if this function returns true
Thanks you!
But the DataAvilable just return a bool value, so I dont know the
available data size, I cant call the read method simply.
Is there more info to solve this problem?
On Friday, 6 March 2015 at 00:57:16 UTC, Ola Fosheim Grøstad
wrote:
On Thursday, 5 March 2015 at 23:50:28 UTC, Jesse Phillips wrote:
I think I read somewhere you don't want to use unions like
this, but I think it is more because you generally don't want
to reinterpret bits.
It is
On Friday, 6 March 2015 at 15:36:47 UTC, anon wrote:
Hi,
I can't figure this out.
struct Pair(T)
{
T x;
T y;
alias x c;
alias y r;
}
What would like is that the x and y to be initialized to
different values depending on type eg:
struct Container
{
Pair!double sample1; //
On 03/06/2015 08:04 AM, Benjamin Thaut wrote:
On Friday, 6 March 2015 at 15:36:47 UTC, anon wrote:
Hi,
I can't figure this out.
struct Pair(T)
{
T x;
T y;
alias x c;
alias y r;
}
What would like is that the x and y to be initialized to different
values depending on type eg:
On Fri, 06 Mar 2015 08:39:55 -0800, Ali Ãehreli wrote:
And an overengineered solution: :p
this is definitely the best.
signature.asc
Description: PGP signature
On Fri, 06 Mar 2015 03:12:44 +, Messenger wrote:
On Thursday, 5 March 2015 at 07:38:35 UTC, ketmar wrote:
On Thu, 05 Mar 2015 06:05:55 +, zhmt wrote:
But I am not familiar with dlang
this is the root of the problem. please, make yourself familiar before
starting to wrap boost crap.
On Friday, 6 March 2015 at 10:16:32 UTC, zhmt wrote:
There should be a function called DataAvilable.
Simply read the data if this function returns true
Thanks you!
But the DataAvilable just return a bool value, so I dont know
the available data size, I cant call the read method simply.
On 6/03/2015 10:30 p.m., zhmt wrote:
I am forwarding data from client to another server, if the client send
data to server,I want to forward that to another server in time.
So, if the server recieves nothing it will wait, if it receive some data
, forward them to another server immediately.
I
On Friday, 6 March 2015 at 09:30:51 UTC, ketmar wrote:
On Fri, 06 Mar 2015 01:19:40 +, zhmt wrote:
Thanks for all the suggestions and pointing the right
direction,I will
learn and try vibe.d, try to use it in my gameserver.
i've seen people using vibe.d to write warcraft server, so it's
On Fri, 06 Mar 2015 01:19:40 +, zhmt wrote:
Thanks for all the suggestions and pointing the right direction,I will
learn and try vibe.d, try to use it in my gameserver.
i've seen people using vibe.d to write warcraft server, so it's
definitely is working. you can find that on github, i
I am forwarding data from client to another server, if the client
send data to server,I want to forward that to another server in
time.
So, if the server recieves nothing it will wait, if it receive
some data , forward them to another server immediately.
I dont think the TCPConnecion.read
Take a look at empty and leastSize.
https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/core/stream.d#L33
@Rikki Cattermole
Thanks for your reply, but it is not what I want, and I cant
implement my goal with them.
in boost::asio, It has a method like this :
On Friday, 6 March 2015 at 10:10:35 UTC, zhmt wrote:
Take a look at empty and leastSize.
https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/core/stream.d#L33
@Rikki Cattermole
Thanks for your reply, but it is not what I want, and I cant
implement my goal with them.
in
I'd say, peek is the right method, it returns what's already in
the buffer (but doesn't read), while leastSize returns full
logical size of the stream.
On Friday, 6 March 2015 at 16:39:56 UTC, Ali Çehreli wrote:
mixin (makePairInitValueDefinitions());
Oh, so that's how you do static foreach.
On Friday, 6 March 2015 at 19:33:56 UTC, zhmt wrote:
On Friday, 6 March 2015 at 18:40:28 UTC, Kagamin wrote:
I'd say, peek is the right method, it returns what's already
in the buffer (but doesn't read), while leastSize returns full
logical size of the stream.
The api of vibe.d is too simple
On Friday, 6 March 2015 at 20:03:52 UTC, Ola Fosheim Grøstad
wrote:
On Friday, 6 March 2015 at 19:33:56 UTC, zhmt wrote:
On Friday, 6 March 2015 at 18:40:28 UTC, Kagamin wrote:
I'd say, peek is the right method, it returns what's already
in the buffer (but doesn't read), while leastSize
On Friday, 6 March 2015 at 18:40:28 UTC, Kagamin wrote:
I'd say, peek is the right method, it returns what's already in
the buffer (but doesn't read), while leastSize returns full
logical size of the stream.
The api of vibe.d is too simple to use in real work.
On 03/06/15 22:29, Artur Skawina wrote:
No, you implement it using CTFE magic, and then that code becomes:
#foreach (N; 0..PairInitValues.length/2) {
enum PairInitValue(T:PairInitValues[$N*2]) = PairInitValues[$N*2+1];
}
Seriously though, avoid using `.stringof` when generating
On 03/06/15 19:27, Kagamin via Digitalmars-d-learn wrote:
On Friday, 6 March 2015 at 16:39:56 UTC, Ali Çehreli wrote:
mixin (makePairInitValueDefinitions());
Oh, so that's how you do static foreach.
No, you implement it using CTFE magic, and then that code becomes:
import std.typetuple;
On 3/4/15 4:15 PM, rumbu wrote:
On Wednesday, 4 March 2015 at 16:08:00 UTC, Steven Schveighoffer wrote:
curiously not listed? That doesn't make any sense. If there is not a
cycle in the listed modules, where at least 2 modules have a static
ctor or static dtor, then there is a bug in the
On Friday, 6 March 2015 at 00:53:49 UTC, Ali Çehreli wrote:
It made me happy that I was not the only person who has been
ruminating over alphabet as the crucial piece in this whole
Unicode story. I've been giving the example of if I have a
company name as the string ali jim, the uppercase of
27 matches
Mail list logo