Bug 18168 – std.base64.encode for output ranges should be usable in @safe

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2018-01-03T03:26:59Z
Last change time
2018-03-12T08:52:35Z
Assigned to
No Owner
Creator
Seb
Blocks
18110

Comments

Comment #0 by greensunny12 — 2018-01-03T03:26:59Z
void test() @safe { import std.base64; struct OutputRange { char[] result; void put(const(char) ch) @safe { result ~= ch; } } ubyte[] data = [0x1a, 0x2b, 0x3c, 0x4d, 0x5d, 0x6e]; OutputRange output; assert(Base64.encode(data, output) == 8); assert(output.result == "Gis8TV1u"); }
Comment #1 by github-bugzilla — 2018-03-12T08:52:35Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/e826c82e3286a8f9f34713ae321c1261a3164d1a Fix Issue 18168 - std.base64.encode for output ranges should be usable in @safe https://github.com/dlang/phobos/commit/f78194889fdd47036133ad995bb4bee9d68fe0c8 Merge pull request #6251 from JackStouffer/issue18168 Fix Issue 18168 - std.base64.encode output ranges @safe merged-on-behalf-of: Sebastian Wilzbach <[email protected]>