www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6447] New: iota(BigInt) too

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6447

           Summary: iota(BigInt) too
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



Sometimes I'd like to generate a range of bigints too:

Enhancement:

import std.bigint: BigInt;
import std.range: iota;
void main() {
    auto x = iota(BigInt(10));
}


Currently DMD gives:

...\std\range.d(4028): Error: template std.range.iota(B,E,S) if
((isIntegral!(CommonType!(B,E)) || isPointer!(CommonType!(B,E))) &&
isIntegral!(S)) does not match any function template declaration
...\std\range.d(4028): Error: template std.range.iota(B,E,S) if
((isIntegral!(CommonType!(B,E)) || isPointer!(CommonType!(B,E))) &&
isIntegral!(S)) cannot deduce template function from argument types
!()(BigInt,BigInt)
test.d(4): Error: template instance std.range.iota!(BigInt) error instantiating

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 06 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6447


Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg gmx.com



PDT ---
BigInt isn't considered an integral by isIntegral, hence why it doesn't work.
We should probably look at having a template in std.traits which covers both
the built-in integral types and BigInt so that those functions which can work
with both have an easy way to test for it. It's either that or every function
that could use BigInt is going to have to test for it explicitly on top of
testing for isIntegral.

Regardless, I don't see any reason why using iota with BigInt shouldn't be made
to work.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 06 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6447


Russel Winder <russel winder.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |russel winder.org.uk



BST ---
I don't have the time, and likely not the knowledge, to fix this and provide a
pull request. Is there anyone who does? This is a two year old problem that
means D is not useful for applications using data types other than the hardware
types, which is a lot of applications.

Is this a symptom of the fact that Phobos is really predicated on use of
hardware types more generally?

(This comment is really to get me on the cc list as there seems to be a
requirement to make a comment in order to add oneself to the cc list :-((

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 28 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6447






 Is this a symptom of the fact that Phobos is really predicated on use of
 hardware types more generally?
I think it's mostly a symptom of D/Phobos not having many contributors :-) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 28 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6447


hsteoh quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hsteoh quickfur.ath.cx





-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 18 2013