Bug 15234 – BigInt's ctor should accept a string range

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-10-22T14:44:00Z
Last change time
2015-12-16T16:47:45Z
Assigned to
nobody
Creator
jack

Comments

Comment #0 by jack — 2015-10-22T14:44:58Z
import std.BigInt; struct MyString { string data; this(string input) { data = input; } char front() { // return the next value in the sequence return data[0]; } void popFront() { // move the front of the sequence to the next value data = data[1 .. $]; } bool empty() { // true if the range has no more values to return return data.length == 0; } } void main() { BigInt a = BigInt(MyString("100")); }
Comment #1 by bearophile_hugs — 2015-10-22T18:54:09Z
Dupe of Issue 15229 ?
Comment #2 by jack — 2015-12-16T16:47:45Z
*** This issue has been marked as a duplicate of issue 15229 ***