On Tuesday, 18 April 2017 at 09:05:10 UTC, Andrea Fontana wrote:
On Tuesday, 18 April 2017 at 00:48:05 UTC, Jethro wrote:
How to combine the need to localize a result for an if
statement and have to call a method to get proper comparison:
[...]
which should simplify to
if ((auto x = foo()).val
On Tuesday, 18 April 2017 at 00:48:05 UTC, Jethro wrote:
How to combine the need to localize a result for an if
statement and have to call a method to get proper comparison:
[...]
which should simplify to
if ((auto x = foo()).valid())
{
}
but this code does not work.
[...]
for(auto x = foo
On 04/18/2017 02:48 AM, Jethro wrote:
I generally need this for regex stuff and it's quite annoying it doesn't
work.
if (!match(s, "\s*(?P.),").empty())
{
// Need the result of match to do things!
}
but this doesn't work:
if (!(auto r = match(s, "\s*(?P.),")).empty())
{
}
Stanislav Blinov
Would be prettier as a language feature, but still:
template test(alias pred)
{
import std.functional : unaryFun;
alias P = unaryFun!pred;
auto test(R)(R r)
{
struct Test
{
R v;
string toString()
{
import std.co
How to combine the need to localize a result for an if statement
and have to call a method to get proper comparison:
if (((auto x = X.value()).empty())
{
}
instead of having to do the long and winded way
auto x = X.value();
if (x.empty())
{
}
Many times I need the result of a function insid