http://d.puremagic.com/issues/show_bug.cgi?id=5980


kenn...@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Can't pass __traits value   |foreach element of a type
                   |as const(char)*             |tuple of string literals is
                   |                            |not implicitly convertible
                   |                            |to immutable(char)*


--- Comment #5 from kenn...@gmail.com 2011-05-11 12:32:41 PDT ---
Actually it's a problem in foreach-ing a TupleExp of StringExp, not __traits. I
changed the title to reflect that.

-------------------------------------
template TypeTuple(T...) {
    alias T TypeTuple;
}
void main() {
    alias TypeTuple!"1" T;
    usefield(T[0]);     // ok
    foreach (j; T)
        usefield(j);    // error on 2.053
}
void usefield(const(char)* foo) {
}
-------------------------------------

(Still, I think it's better to use .ptr then relying on it the implicit string
literal -> pointer conversion.)

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

Reply via email to