www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10919] New: typeof should accept types

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

           Summary: typeof should accept types
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: doob me.com


--- Comment #0 from Jacob Carlborg <doob me.com> 2013-08-28 23:52:24 PDT ---
Currently typeof only accepts expressions. I think it would be useful if typeof
accepts types as well and just evaluate to the type given. This will make
metaprogramming simpler.

void foo (alias T) ()
{
    alias U = typeof(T);
}

foo!(3); // ok
foo!(Object); // error, Object is not an expression

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



--- Comment #1 from Don <clugdbug yahoo.com.au> 2013-08-30 00:53:32 PDT ---
See bug 1341.

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


timon.gehr gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr gmx.ch


--- Comment #2 from timon.gehr gmx.ch 2013-08-30 17:38:27 PDT ---
This enhancement does not make any sense. int is not an int, it is a type. 0 is
an int. A helper template can be used if an expression is desired that behaves
in this way.

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


Temtaime <temtaime gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |temtaime gmail.com


--- Comment #3 from Temtaime <temtaime gmail.com> 2013-08-31 01:45:50 PDT ---
I'm agree with Timon.

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