std.base64 question

Parke parke.nexus at gmail.com
Tue Nov 26 18:43:54 PST 2013


Hi,

The following does not compile, and I do not understand what I am 
doing wrong.

import std.base64;
ubyte[]  s0 = ['H','e','l','l','o'];
char[40] s1;
void main () {
   Base64.encode (s0, s1);
}

The compile error is:

[snip]/src/phobos/std/range.d(614): Error: static assert  "Cannot 
put a immutable(char) into a char[40]"
[snip]/src/phobos/std/base64.d(297):        instantiated from 
here: put!(char[40], immutable(char))
test.d(7):        instantiated from here: encode!(ubyte[], 
char[40])

Thanks!


More information about the Digitalmars-d-learn mailing list