www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6191] New: removechars doesn't accept a const string

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

           Summary: removechars doesn't accept a const string
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



DMD 2.053:

import std.string;
void main() {
    const string s = "foo5x";
    auto s2 = removechars(s, "^A-Z");
}


test.d(4): Error: template std.string.removechars(S) if (isSomeString!(S)) does
not match any function template declaration
test.d(4): Error: template std.string.removechars(S) if (isSomeString!(S))
cannot deduce template function from argument types
!()(const(immutable(char)[]),string)


(Additionally, removechars is not pure nothrow.)

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


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
Compiles and runs fine on 2.059 Win32

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 22 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6191


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



import std.string, std.stdio;
void main() nothrow {
    const string s = "foAo5x";
    auto s2 = removechars(s, "^A-Z");
}


With dmd 2.060alpha it gives:
test.d(4): Error: removechars is not nothrow
test.d(2): Error: function D main 'main' is nothrow yet may throw


So removechars is not nothrow, but the main problem is fixed, so I close this
issue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 24 2012