Topic: Non-terminal default arguments?
Author: kprateek88@yahoo.com (Prateek R Karandikar)
Date: Tue, 7 Sep 2004 22:30:02 GMT Raw View
Both while declaring parameters and passing arguments (both function
and template) why is there the restriction that the defaults have to
be at the end? What is wrong in saying f(5,7, , , 89)? Or
std::map< A, B, , Custom_Allocator> x;
Just the consecutive commas ? IMHO, there is nothing wrong in that.
-- --
Abstraction is selective ignorance.
-Andrew Koenig
-- --
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
Author: Michiel.Salters@logicacmg.com (Michiel Salters)
Date: Wed, 8 Sep 2004 13:54:09 GMT Raw View
kprateek88@yahoo.com (Prateek R Karandikar) wrote in message news:<607f883e.0409070141.18fab958@posting.google.com>...
> Both while declaring parameters and passing arguments (both function
> and template) why is there the restriction that the defaults have to
> be at the end? What is wrong in saying f(5,7, , , 89)? Or
>
> std::map< A, B, , Custom_Allocator> x;
> Just the consecutive commas ? IMHO, there is nothing wrong in that.
Too easy to miss reading. There are proposals to allow it, as
std::map< A, B, default, Custom_Allocator> x;
The keyword default is reserved, currently illegal in the context
and quite clear.
Regards,
Michiel Salters
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]