I'm trying to understand why the following doesn't work:
import std.stdio;
import std.variant;
void main()
{
Algebraic!(string, int) test = "Test";
test.tryVisit!(
(ref string s) { s = "Why does this not work?"; }
);
writeln(test);
}
But this works fine:
*test.peek!str
On Tuesday, 20 February 2018 at 16:15:56 UTC, Radu wrote:
On Tuesday, 20 February 2018 at 16:01:11 UTC, Smaehtin wrote:
I'm trying to understand why the following doesn't work:
import std.stdio;
import std.variant;
void main()
{
Algebraic!(string, int) test = "Test";
test.tryVisit!(
On Tuesday, 20 February 2018 at 16:20:45 UTC, Smaehtin wrote:
On Tuesday, 20 February 2018 at 16:15:56 UTC, Radu wrote:
On Tuesday, 20 February 2018 at 16:01:11 UTC, Smaehtin wrote:
I'm trying to understand why the following doesn't work:
import std.stdio;
import std.variant;
void main()
{
On Wednesday, 21 February 2018 at 09:21:58 UTC, 0x wrote:
What is the equivalent of C++17 std::string_view (an object
that can refer to a constant contiguous sequence of char-like
objects with the first element of the sequence at position
zero) in D?
PS: I'm getting back to D after ye