Thank you very much, I thought the operators are alrdy checked by
if (op == + || op == - || op == /)
But I did same tests for ushort uint and ulong, but for ulong it
didn't compile.
unittest{
alias sulong = Saturated!ulong;
assert(sulong(18_446_744_073_709_551_610) + sulong(2) ==
Namal:
And if so, do I always have to use a suffix when the number is
bigger than uint?
It looks a bit silly, I agree.
Bye,
bearophile
On Saturday, 25 May 2013 at 10:15:42 UTC, bearophile wrote:
Namal:
And if so, do I always have to use a suffix when the number is
bigger than uint?
It looks a bit silly, I agree.
Bye,
bearophile
Well, now I have same Error for signed long:
else{
static if (op == +){
On 05/25/2013 04:34 AM, Namal wrote:
assert(slong(9_223_372_036_854_775_806) + slong(-3) ==
slong(-9_223_372_036_854_775_808));
}
The first test is ok, but second wont even compile. Even if I append a L
to each number.
According to the Integer Literals section here:
Heinz:
template makeId(char[4] id)
{
const makeId = id[0] 24 | id[1] 16 | id[2] 8 | id[3];
}
const kPIHostBlendModeSignature = makeId!(8BIM);
Generally it's more descriptive to use enum (or even a CT
function):
template makeId(char[4] id)
{
enum makeId = (id[0] 24) |
Thanks, that helped me alot.
Is there a reason for restricting mixin templates to only include
declarations?
For example, the following code doesn't work.
(http://dpaste.dzfl.pl/1582a25e)
Looking at the language specification
(http://dlang.org/template-mixin.html) this doesn't seem to be an
implementation limitation.
On Saturday, 25 May 2013 at 18:05:01 UTC, yaz wrote:
Is there a reason for restricting mixin templates to only
include declarations?
For example, the following code doesn't work.
(http://dpaste.dzfl.pl/1582a25e)
Looking at the language specification
(http://dlang.org/template-mixin.html) this
On Saturday, 25 May 2013 at 18:28:09 UTC, Diggory wrote:
I think you can do it using a string mixin instead:
enum Test = `writeln(Hello D People!)`
void main() {
mixin(Test);
}
The answer to your question is probably that D has to know the
context for a template mixing at the point where
On Saturday, 25 May 2013 at 18:28:09 UTC, Diggory wrote:
D has to know the context for a template mixing at the point
where it is declared rather than where it is used.
Quite the opposite in fact. Templates exist in the context that
they are defined in, mixin templates in the context where
I have one more question towards using unsigned datatype
assert(sint(-2_147_483_647) - sint(3) == sint(-2_147_483_648));
assert(sint(-2_147_483_647) - sint(3) == sint(2_147_483_648));
Here I get an error for the second line, because it cannot be
convertet
if i use unsigned
Ok, uhhh...How do I do it?
I did already grab
http://www.sqlite.org/2013/sqlite-dll-win32-x86-3071700.zip which
contains sqlite3.dll and sqlite3.def, FWIW.
Is there any examples of using inotify with D?
http://en.wikipedia.org/wiki/Inotify
I've updated the old tango header file and tried to get something
working but it seems to hang. If anyone else has code using
inotify i'd love to take a look to see how you have used it. ta.
On 5/25/13, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote:
Ok, uhhh...How do I do it?
Never used sqlite, but for implicit linking you need an import library
which you then just pass to DMD at command-line. Use implib[1],
probably with the /system switch on the DLL (or on the .def
On Sun, 26 May 2013 00:03:01 +0200
Andrej Mitrovic andrej.mitrov...@gmail.com wrote:
On 5/25/13, Nick Sabalausky seewebsitetocontac...@semitwist.com
wrote:
Ok, uhhh...How do I do it?
Never used sqlite, but for implicit linking you need an import library
which you then just pass to DMD at
On 05/25/2013 11:57 AM, Namal wrote:
I have one more question towards using unsigned datatype
assert(sint(-2_147_483_647) - sint(3) == sint(-2_147_483_648));
assert(sint(-2_147_483_647) - sint(3) == sint(2_147_483_648));
Here I get an error for the second line, because it cannot be
I have a project here which fails on link on ubuntu 12.10.
It give undefined reference errors for functions in libdl and libutil.
For some reason, ld won't cooperate unless you pass -ldl -lutil at the
end of the command string. Holy Ubuntu!
I can't seem to get dmd to do this though. Any
On Sunday, 26 May 2013 at 05:01:10 UTC, Ellery Newcomer wrote:
I have a project here which fails on link on ubuntu 12.10.
It give undefined reference errors for functions in libdl and
libutil. For some reason, ld won't cooperate unless you pass
-ldl -lutil at the end of the command string.
Just to clarify:
-I = flag to specify include path
-L-L = flag to specify additional library search path
-L-l = flag to specify link library
/Stewart
19 matches
Mail list logo