On Tuesday, 20 August 2019 at 09:49:21 UTC, Daniel Kozak wrote:
On Tue, Aug 20, 2019 at 11:30 AM ads via Digitalmars-d-learn
wrote:
you do not allow a person to think about a problem (and it’s easy
here).
you carried him through a puddle now, but when he dives into Sea
D, you will not be t
On Tuesday, August 20, 2019 3:27:36 AM MDT ads via Digitalmars-d-learn
wrote:
> import std.stdio;
>
> ubyte[] extend(in uint[] arr)
> {
> ubyte[] result;
> foreach (n; arr)
> {
> if (n < 10)
> {
> result ~= n;
> // source/app.d(10,11): Error: ca
On Tuesday, 20 August 2019 at 09:27:36 UTC, ads wrote:
import std.stdio;
ubyte[] extend(in uint[] arr)
{
ubyte[] result;
foreach (n; arr)
{
if (n < 10)
result ~= n;
else
{
impo
On Tue, Aug 20, 2019 at 11:30 AM ads via Digitalmars-d-learn
wrote:
>
>
> How can I get around this? I want to ensure that the array is not
> mutated in the function in the signature too.
>
https://run.dlang.io/is/tehp3j
import std.stdio;
ubyte[] extend(in uint[] arr)
{
ubyte[] result;
import std.stdio;
ubyte[] extend(in uint[] arr)
{
ubyte[] result;
foreach (n; arr)
{
if (n < 10)
{
result ~= n;
// source/app.d(10,11): Error: cannot
append type const(uint) to type ubyte[]