On Wednesday, 14 February 2024 at 11:56:29 UTC, Forest wrote:
On Wednesday, 14 February 2024 at 10:57:42 UTC, RazvanN wrote:
This has already been fixed, you just need to use
-preview=fixImmutableConv. This was put behind a preview flag
as it introduces a breaking change.
I just tried that
On Friday, 17 December 2021 at 07:52:18 UTC, rempas wrote:
I want to use an expression and put it in place inside the `if`
parentheses. The expression is: `is(typeof(val) == type)`. I
want to use a template called "is_same" that will take the
value and a type to place them to the respective pla
On Sunday, 12 December 2021 at 11:57:43 UTC, vit wrote:
Hello, why does this code fail to compile?
```d
struct Foo(T){
this(Rhs, this This)(scope Rhs rhs){
}
this(ref scope typeof(this) rhs){
}
}
struct Bar{
Foo!int foo;
}
void main(){
}
```
error: Segmentation fault
On Tuesday, 14 December 2021 at 13:02:16 UTC, Tejas wrote:
On Tuesday, 14 December 2021 at 12:04:36 UTC, RazvanN wrote:
[...]
Then why did my modification work?
```d
struct Foo(T){
this(Rhs, this This)(scope Rhs rhs){
}
this(scope Foo!(T)* rhs){ //replaced typeof(this) with
Foo!
On Sunday, 12 December 2021 at 11:57:43 UTC, vit wrote:
Hello, why does this code fail to compile?
```d
struct Foo(T){
this(Rhs, this This)(scope Rhs rhs){
}
this(ref scope typeof(this) rhs){
}
}
struct Bar{
Foo!int foo;
}
void main(){
}
```
error: Segmentation fault
On Monday, 12 July 2021 at 23:57:37 UTC, Scotpip wrote:
Hi guys
Just installed the DMD 2.097.0 .exe download for Windows on my
64 bit Win 10 workstation.
[...]
PR: https://github.com/dlang/installer/pull/484
On Thursday, 15 July 2021 at 11:08:25 UTC, Per Nordlöw wrote:
The adding of copy construtors to `Service` defined as
```d
@safe struct Service {
this(ref return scope typeof(this) rhs) {}
this(const ref return scope typeof(this) rhs) const {}
}
@safe struct Session {
void openAndGet
On Tuesday, 5 May 2020 at 05:37:08 UTC, Simen Kjærås wrote:
On Tuesday, 5 May 2020 at 04:02:06 UTC, RazvanN wrote:
[...]
Surely the above code, which silently discards the exception,
does not print "hello"?
Regardless, I ran your code with writeln inside the catch(),
and without the try-ca
truct K
{
~this() nothrow {}
}
void main()
{
static class C
{
this(K, int) {}
}
static int foo(bool flag)
{
if (flag)
throw new Exception("hello");
return 1;
}
try
{
new C(K(), foo(true));
}
catch(Exception)
On Monday, 4 February 2019 at 22:54:01 UTC, James Blachly wrote:
I tried to implement an interval tree backed by
std.container.rbtree today and fell flat.
[...]
You can use alias this [1] in your interval element type:
struct IntervalElem
{
size_t start, end;
/* ... other declarations
On Thursday, 10 January 2019 at 23:04:37 UTC, Steven
Schveighoffer wrote:
On 1/10/19 5:12 PM, RazvanN wrote:
On Thursday, 10 January 2019 at 15:04:25 UTC, Steven
Schveighoffer wrote:
On 1/8/19 7:54 AM, RazvanN wrote:
[...]
That is a thread-local static destructor. Are any shared
static dest
On Thursday, 10 January 2019 at 15:04:25 UTC, Steven
Schveighoffer wrote:
On 1/8/19 7:54 AM, RazvanN wrote:
[...]
That is a thread-local static destructor. Are any shared static
destructors accessing the array?
No, there aren't. Indeed, the problem is as Johan as said: the
loadedDSOs shoul
On Tuesday, 8 January 2019 at 14:30:24 UTC, Johan Engelen wrote:
On Tuesday, 8 January 2019 at 12:54:11 UTC, RazvanN wrote:
[...]
Great!
(I am _extremely_ surprised that dtors are not called for
globals.)
[...]
Thanks! This is really helpful!
RazvanN
Hi all,
I am working on issue 14650 [1] and I would like to implement a
solution where static destructors are destroying global
variables. However, I have the following problem in
druntime/src/rt/sections_elf_shared:
struct ThreadDSO
{
DSO* _pdso;
static if (_pdso.sizeof == 8) uint _
On Thursday, 19 July 2018 at 09:50:32 UTC, Jim Balter wrote:
On Thursday, 19 July 2018 at 08:50:15 UTC, RazvanN wrote:
struct A
{
int a;
@disable ~this() {}
}
void main()
{
A a = A(2);
}
Currently, this code yields:
Error: destructor `A.~this` cannot be used because it is
annotat
struct A
{
int a;
@disable ~this() {}
}
void main()
{
A a = A(2);
}
Currently, this code yields:
Error: destructor `A.~this` cannot be used because it is
annotated with @disable
I was expecting that disabling the destructor would make it as if
the struct does not have a destruct
Honestly, from what I understand of how this works, what I find
weird is the struct case. immutable on classes does _not_ make
the class itself immutable. It just makes all of its members
immutable - hence the error about trying to allocate new Foo
instead of new immutable Foo. So, that is exac
Hello,
I'm having a hard time understanding whether this inconsistency
is a bug or intended behavior:
immutable class Foo {}
immutable struct Bar {}
void main()
{
import std.stdio : writeln;
Foo a;
Bar b;
writeln("typeof(a): ", typeof(a).stringof);
writeln("typeof(b): ",
Hi all,
Let's say we have this code:
struct B
{
int a;
this(int a) immutable
{
this.a = 7;
}
this(int a)
{
this.a = 10;
}
}
void main()
{
B a = immutable B(2);
writeln(a.a);
a.a = 4;
immutable B a2 = immutable B(3);
writeln(a2.a)
On Thursday, 22 February 2018 at 13:21:04 UTC, joe wrote:
On Monday, 12 February 2018 at 08:47:58 UTC, RazvanN wrote:
Hi Joe,
/SNIP
On Tuesday, 6 February 2018 at 12:03:06 UTC, joe wrote:
[...]
The FuncDeclaration node contains all the information for that.
For example, you can access fd.pa
On Thursday, 15 February 2018 at 13:51:41 UTC, drug wrote:
15.02.2018 16:50, drug пишет:
https://run.dlang.io/is/zHT2XZ
I can check againts if member is either static function or
template. But I failed to check if it both static and templated.
The best I could come up with is:
struct Foo
{
Hi Joe,
I suggest you watch this video which explains how the parse time
visitors work: https://www.youtube.com/watch?v=tK072jcoWv4 .
On Tuesday, 6 February 2018 at 12:03:06 UTC, joe wrote:
Hello everybody!
Last week end I found this post (
https://dlang.org/blog/2017/08/01/a-dub-case-study
On Thursday, 9 November 2017 at 14:21:52 UTC, Steven
Schveighoffer wrote:
On 11/8/17 10:45 PM, Andrey wrote:
I just added to dub.json this:
"-ddoxFilterArgs": [
"--min-protection=Public"
]
i.e. without --only-documented option, in this way ddox will
generate documentation for all publi
On Wednesday, 11 October 2017 at 11:26:11 UTC, rikki cattermole
wrote:
On 11/10/2017 12:09 PM, RazvanN wrote:
Hi all,
I have seen that the concurrency api has this method specified
in $title [1] and I was wondering what is the use of it?
Enabling threads to modify the message box of other thr
Hi all,
I have seen that the concurrency api has this method specified in
$title [1] and I was wondering what is the use of it? Enabling
threads to modify the message box of other threads doesn't seem
to be a good idea and I can't think of any real use case.
Best regards,
RazvanN
[1]
https
On Friday, 6 January 2017 at 13:22:28 UTC, llaine wrote:
Did anyone used Tensorflow with D ? I would be really
interesting to know if some libs allows it right now.
I read an old thread about TS on the forum, but since then
nothing ...
At the moment there is no support in D to use TensorFlow
On Monday, 19 December 2016 at 20:26:26 UTC, Ali Çehreli wrote:
On 12/19/2016 06:09 AM, RazvanN wrote:
> [...]
wrote:
>> [...]
InputRanges.
>> [...]
following
> [...]
char[]
> [...]
function, so
> [...]
http://dlang.org/phobos/std_algorithm_mutation.html#bringToFront
[...]
No need to mention i
On Monday, 19 December 2016 at 12:25:02 UTC, Ali Çehreli wrote:
On 12/19/2016 02:41 AM, RazvanN wrote:
> [...]
As your comments make it clear below, they cannot be
InputRanges.
> [...]
swapping code
> [...]
Obivously, tmp1 and tmp2 are unusued there. :)
> [...]
passed.
> [...]
stat
Hi,
I have a function which accepts 2 input Ranges and swaps the
first element in Range1 with the first element in Range2. The
swapping code looks something like this :
static if (is(typeof(swap(r1.front, r2.front
{
swap(r1.front, r2.front);
}
else
{
Hi,
I am trying to create a range with uncopyable elements. My
thought process was the following:
1.I have created a struct :
struct S
{
int a;
@disable this(this);
}
2. I declared an array :
S[] arr = [S(1), S(2), S(3)];
expecting that arr will be a range like, for example, an in
On Tuesday, 22 November 2016 at 14:23:28 UTC, Jonathan M Davis
wrote:
On Tuesday, November 22, 2016 13:29:47 RazvanN via
Digitalmars-d-learn wrote:
[...]
You misunderstand. char[] is a dynamic array of char, wchar[]
is a dynamic array of wchar[], and dchar[] is a dynamic array
of dchar
Given the following code:
char[5] a = ['a', 'b', 'c', 'd', 'e'];
alias Range = char[];
writeln(is(ElementType!Range == char));
One would expect that the program will print true. In fact, it
prints false and I noticed that if Range is char[], wchar[],
dchar[], string, wstring, dstring
Unqual
On Tuesday, 15 November 2016 at 09:43:27 UTC, RazvanN wrote:
The find function which receives an input haystack and a needle
returns the haystack advanced to the first occurrence of the
needle. For normal ranges this is fine, but for
sorted ranges (aka SortedRange) it is a bit odd. For example:
The find function which receives an input haystack and a needle
returns the haystack advanced to the first occurrence of the
needle. For normal ranges this is fine, but for
sorted ranges (aka SortedRange) it is a bit odd. For example:
find(assumeSorted[1, 2, 4, 5, 6, 7], 4) would return [4, 5,
On Friday, 11 November 2016 at 13:33:20 UTC, Vladimir Panteleev
wrote:
On Friday, 11 November 2016 at 13:30:17 UTC, RazvanN wrote:
I know that I can use the .array property, but I think that
this iterates through all of my elements. Using
assumeSorted(chain(r1, r2).array) will return a SortedRa
I am trying to concatenate 2 ranges of the same type (SortedRange
in my case). I have tried merge, join and chain, but the problem
is that the result is not an object of the type of the initial
ranges. For example:
1. If I use chain(r1, r2), the result will be an object of type
Result which I
On Friday, 11 November 2016 at 12:02:10 UTC, ketmar wrote:
On Friday, 11 November 2016 at 11:49:25 UTC, RazvanN wrote:
[...]
template isSortedRange(T) {
private import std.range : SortedRange;
static if (is(T : SortedRange!TT, TT)) {
enum isSortedRange = true;
} else {
enum isSo
I am a bit confused about how the is operator works. I have a
function which receives an InputRange and a predicate. Now I need
to be able to test if the InputRange is actually a SortedRange. I
don't care about how the datatypes behind the SortedRange or the
predicate, I just need to see if the
Given a SortedRange object, is there a way to obtain the
predicate which was used for it to be sorted?
On Tuesday, 8 November 2016 at 13:59:19 UTC, Nicholas Wilson
wrote:
On Tuesday, 8 November 2016 at 13:22:35 UTC, RazvanN wrote:
Sorry, I accidentally posted the above message and I don't
know how to erase it.
You can't, this is a mailing list not a forum.
The following post is the complete o
Sorry, I accidentally posted the above message and I don't know
how to erase it.
The following post is the complete one:
Given the following code:
int[] arr = [1, 2, 9, 4, 10, 6];
auto r= sort(arr);
if(is(typeof(r) == SortedRange!(int[], "aThe program outputs only "second if". I assumed th
Given the following code:
int[] arr = [1, 2, 9, 4, 10, 6];
auto r= sort(arr);
if(is(typeof(r) == SortedRange!(int[], "a
42 matches
Mail list logo