On Thursday, 20 July 2017 at 15:10:24 UTC, Aldo wrote:
On Thursday, 20 July 2017 at 14:59:50 UTC, Steven Schveighoffer
wrote:
On 7/20/17 10:38 AM, Aldo wrote:
Hello,
im tring to add nothrow keyword in my code, but compilation
fails :
function 'object.opEquals' is not nothrow
its a simple
On Tuesday, 28 April 2015 at 10:46:54 UTC, Gary Willoughby wrote:
After reading the following thread:
http://forum.dlang.org/thread/nczgumcdfystcjqyb...@forum.dlang.org
I wondered if it was possible to write a classic fizzbuzz[1]
example using a UFCS chain? I've tried and failed.
[1]: http:/
On Tuesday, 7 April 2015 at 06:37:50 UTC, Jonathan wrote:
static if (is(T == V))
Are static ifs always checked outside of runtime? Is it
possible for a static if condition to be undeterminable outside
of runtime, or would such a condition throw a compiler error?
'static if' is always run at
On Sunday, 5 April 2015 at 23:06:27 UTC, FreeSlave wrote:
I have array of structs sorted by specific field. How can I
perform binary search using this field as a key?
Currently I ended up with this, but it gives error:
struct S
{
int i;
string s;
}
import std.range;
void main(string
Mutual tail call optimisation doesn't work in C++ either.
Because it's not a language feature in C++ or D. It is not
required by the standards of either language. It's an
optimisation which compilers apply. I am guessing you are using
DMD, which might not offer the best optimisations for runti
On Thursday, 5 March 2015 at 19:35:35 UTC, Chris Sperandio wrote:
Hi,
I'm a developer coming from C and I've a question about class
instance as method or function parameter.
In the book "The D Programming Language", I read the instance
was passed by reference to functions (in the opposite of
On Wednesday, 25 February 2015 at 06:48:17 UTC, Ola Fosheim
Grøstad wrote:
On Tuesday, 24 February 2015 at 22:49:17 UTC, w0rp wrote:
In general, @trusted means "I have proven myself that this
code is actually safe, eeven though it uses unsafe features."
The compiler has to be pessi
On Tuesday, 24 February 2015 at 22:37:58 UTC, Ola Fosheim Grøstad
wrote:
If this is careful use of @trusted, then I don't see the point
of having @trusted at all. What is the purpose? What is it
meant to cover? In order for @trusted to make sense in this
code segment ( http://dpaste.dzfl.pl/f3d
I hit this myself also. I was trying to use the master branch
DMD, druntime, and phobos with a recent vibe.d for building the
documentation with ddox, and I ran into the reliance on
std.metastrings.
On Wednesday, 18 June 2014 at 20:55:36 UTC, cym13 wrote:
Hello,
I see a lot of functions and other stuff with a '!' in the name
such as 'bitfields!' or 'ctRegex!'. What does it mean exactly?
In
scheme, we use such a convention to warn that a function is not
pure, but I don't see the point of u
On Saturday, 24 May 2014 at 18:01:43 UTC, Ali Çehreli wrote:
On 05/24/2014 10:02 AM, w0rp wrote:
> I have been writing my own hashmap which can provide forward
ranges
> usable in @safe pure nothrow functions, because it's going to
be useful
> for creating graph data structures wi
I have been writing my own hashmap which can provide forward
ranges usable in @safe pure nothrow functions, because it's going
to be useful for creating graph data structures with the same. I
came to writing my ranges and I figured out how to do everything
right for just mutable hashmaps, but I
On Saturday, 17 May 2014 at 20:06:03 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
But I think that the correct solution is to improve the
compiler with regards
to lazy. The fact that lazy is so slow is a serious problem,
and enforce is
just one manifestation of it (albeit the worst becau
On Thursday, 3 April 2014 at 10:42:33 UTC, monarch_dodra wrote:
A correctly implemented AA would use opCmp to store objects in
each bucket in cases of hash collisions, but still use opEqual
in case of equivalence.
I would add to that, "try to use opCmp if it is available." It
should be possib
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(";
On Friday, 28 March 2014 at 20:47:39 UTC, JR wrote:
On Friday, 28 March 2014 at 13:42:43 UTC, w0rp wrote:
size_t dotIndex = qualName.retro.countUntil('.');
if (dotIndex < 0) {
size_t is unsigned. :3
(So ptrdiff_t -- or simply auto.)
Oh yes, that is a bug. There's a
You could do the following.
class Klass {
static class SubKlass {
}
}
string baseName(ClassInfo classinfo) {
import std.array;
import std.algorithm : countUntil;
import std.range : retro;
string qualName = classinfo.name;
size_t dotIndex = qualName.retro.countUntil(
On Thursday, 13 March 2014 at 14:38:27 UTC, ref2401 wrote:
Hi.
I have this structure:
struct MyStruct {
enum MyStruct VALUE = MyStruct(5f);
static immutable MyStruct value = MyStruct(5f);
float data;
this(float v) { data = v; }
}
What's the difference between
On Thursday, 20 February 2014 at 19:58:10 UTC, Stanislav Blinov
wrote:
On Thursday, 20 February 2014 at 19:46:35 UTC, w0rp wrote:
if (s.length > 0 && s.all!isDigit) {
// Never throws now.
auto x = parse!int(s);
}
And what about +/- and U/L suffixes? Or, say, different
On Thursday, 20 February 2014 at 19:23:28 UTC, Cooler wrote:
On Thursday, 20 February 2014 at 19:18:15 UTC, Stanislav Blinov
wrote:
On Thursday, 20 February 2014 at 19:11:55 UTC, Cooler wrote:
The code:
string s = "...";
if(s.isNumeric){
auto x = parse!int(s); // Can I be sure here that pars
On Sunday, 22 September 2013 at 23:09:52 UTC, Charles Hixson
wrote:
I'm trying to use a C++ library that allocates data and returns
a pointer to it. It tells me that I should delete the data
when I'm through with it.
Can I do this from within D? Or do I need to write some C++
code to manage
You are invoking a function effectively stored statically in a
class namespace. So you never actually dereference the null
reference. You're just calling a function that doesn't really
have anything to do with the reference. I prefer to tell it like
it is and call the static method with the cla
On Thursday, 13 June 2013 at 19:47:23 UTC, Agustin wrote:
I would like to know if static members are shared between 2
library. For example:
Class A
{
static uint var;
}
From Library A:
A::var = 3;
From Library B:
if( A::var == 3 )
...
Its this possible? if not, its any way to make it ha
On Friday, 7 June 2013 at 21:18:12 UTC, Jonathan M Davis wrote:
I have an open pull request as part of the move to getting rid
of opEquals,
opCmp, toHash, and toString from Object, and it would make it
so that you
could use something other than Object
Oh, that's cool. I didn't know about th
On Friday, 7 June 2013 at 21:02:15 UTC, Namespace wrote:
Yes, I remember. As I heard it the first time I thought it's
because of the limited compiler and that it will fixed some day.
opEquals for classes is interesting because you actually do need
to write 'Object' there because of type poly
On Friday, 7 June 2013 at 20:51:13 UTC, Namespace wrote:
I got it. I must use Object instead of A... How ridiculous. I
thought this was already fixed...
The class opEquals is quite like .equals in Java. You need to
match the signature of Object, which is implicitly the base class
of all class
26 matches
Mail list logo