www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 242] New: template implicit template properties doesn't work

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

           Summary: template implicit template properties doesn't work
           Product: D
           Version: 0.162
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: oskar.linde gmail.com


template x() { template x() { const x = 1; } }
void main() { const y = x!()!(); }

Gives:
test.d(2): semicolon expected following auto declaration, not '!'
test.d(2): found '!' instead of statement

Instead, trying const y = x!().x!(), gives 

test.d(2): template identifier x is not a member of x

I can't see any way to instantiate the inner template when it is "an implicit
template property".


-- 
Jul 06 2006
next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-07-06:
 http://d.puremagic.com/issues/show_bug.cgi?id=242

 template x() { template x() { const x = 1; } }
 void main() { const y = x!()!(); }

 Gives:
 test.d(2): semicolon expected following auto declaration, not '!'
 test.d(2): found '!' instead of statement

 Instead, trying const y = x!().x!(), gives 

 test.d(2): template identifier x is not a member of x

 I can't see any way to instantiate the inner template when it is "an implicit
 template property".

Added to DStress as http://dstress.kuehne.cn/run/t/template_37_A.d http://dstress.kuehne.cn/run/t/template_37_B.d http://dstress.kuehne.cn/run/t/template_37_C.d http://dstress.kuehne.cn/run/t/template_37_D.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFErkiFLK5blCcjpWoRAqT2AJ9WQKSU7tTiUxfIH2XOQ4dO5oCLzACgpm9E DyfsYYgZultsc0f067beVSg= =RZF5 -----END PGP SIGNATURE-----
Jul 07 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=242





------- Comment #1 from wbaxter gmail.com  2006-11-28 09:43 -------
(In reply to comment #0)
 template x() { template x() { const x = 1; } }
 void main() { const y = x!()!(); }
 
 Gives:
 test.d(2): semicolon expected following auto declaration, not '!'
 test.d(2): found '!' instead of statement
 
 Instead, trying const y = x!().x!(), gives 
 
 test.d(2): template identifier x is not a member of x
 
 I can't see any way to instantiate the inner template when it is "an implicit
 template property".
 

Especially now with tuples, it would be nice if something like the x!()!() above worked. Because: * A template can only have one tuple parameter. * Multiple tuples passed into a tuple-taking template get merged into a single tuple. Thus nested tuple templates seems to be the best hope for writing algorithms that process or combine multiple tuples. template x(S...) { template x(T...) { /*use S and T together*/ } } x!(int,float)!(3,24.0) (And even if the inner one is not named x, you still can't do x!().y!() right now.) --
Nov 28 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=242


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au
           Severity|normal                      |enhancement




--- Comment #2 from Don <clugdbug yahoo.com.au>  2009-05-26 00:47:53 PDT ---
This is an enhancement.

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


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simen.kjaras gmail.com


--- Comment #3 from Don <clugdbug yahoo.com.au> 2010-04-09 00:33:42 PDT ---
*** Issue 4061 has been marked as a duplicate of this issue. ***

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



--- Comment #4 from Don <clugdbug yahoo.com.au> 2010-05-25 13:33:59 PDT ---
*** Issue 4233 has been marked as a duplicate of this issue. ***

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


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrei metalanguage.com
         Resolution|                            |INVALID
         AssignedTo|nobody puremagic.com        |bugzilla digitalmars.com


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