[Issue 15234] New: BigInt's ctor should accept a string range
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Thu Oct 22 07:44:58 PDT 2015
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15234
          Issue ID: 15234
           Summary: BigInt's ctor should accept a string range
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: jack at jackstouffer.com
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"));
}
--
    
    
More information about the Digitalmars-d-bugs
mailing list