[Issue 9112] Uniform construction for built-in types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 7 10:39:09 PST 2012


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


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #11 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-12-07 10:39:02 PST ---
(In reply to comment #0)
> So I'd like to propose new syntax to reduce such concept confusion.
> 
> int n = int(10);  // same as cast(int)10;

So we're introducing C++-style casts into D? This means you can no longer
search for 'cast' and expect to find all the unsafe casts in your code. I'm
very much against this, and if I remember right Walter was also against this.

> From the meta-programming view, we can represent default construction of value
> types by T().

We can also use a library template to do it without introducing new syntax. If
orthogonality is needed because of metaprogramming then why not just implement
a template in Phobos?

We really don't need 10 ways of doing the same thing with a different syntax..

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


More information about the Digitalmars-d-bugs mailing list