From: Stefan Heinzmann (stefan_heinzmann_at_[hidden])
Date: 2006-11-03 07:41:24
--- Gunter Winkler <guwi17_at_[hidden]> wrote:
> hmm ... I prefer to have only one name for all conversions.
> Maybe I
> change the order of the arguments:
I have some sympathy for using the same name, but in the case
I mentioned the name actually contradicted the real
situation, which is always to be avoided IMHO. If you want to
keep the same name, I believe it would make more sense to
call the operation simply "make_matrix" or "make_vector".
What from is determined by the arguments and needs no extra
There are, however, shortcomings when using overloading here.
Sometimes you might want to take the address of such a
function, and having several overloaded versions makes that
rather inconvenient. And, of course, there's a danger to run
into ambiguities when having too many overloads.
I also believe that the version taking a pointer to a
2D-array isn't adding any value when there's already a
version that takes a reference. On the contrary, the pointer
version would also happily accept arguments that are actually
3D-arrays, through pointer decay. I think that can be
surprising and unwanted.
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de