Topic: N1647 - Naming of xor_combine members


Author: bop@gmb.dk ("Bo Persson")
Date: Mon, 26 Apr 2004 01:53:13 +0000 (UTC)
Raw View
I have a problem with names like base1_type and base2_type. Why choose
names that are almost identical?

In std::pair we have first_type and second_type. In std::unary_function
we have first_argument_type and second_argument_type.

Isn't that precedence enough to choose names like first_base_type and
second_base_type here?


Bo Persson


---
[ 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: Mon, 26 Apr 2004 16:59:00 +0000 (UTC)
Raw View
bop@gmb.dk ("Bo Persson") wrote in message news:<c6h3hc$bitkr$1@ID-206811.news.uni-berlin.de>...
> I have a problem with names like base1_type and base2_type. Why choose
> names that are almost identical?
>
> In std::pair we have first_type and second_type. In std::unary_function
> we have first_argument_type and second_argument_type.

I think it's binary_function that has a second_argument_type :-)

> Isn't that precedence enough to choose names like first_base_type and
> second_base_type here?

Of course, it's bind1st and bind2nd, not bind_first and bind_second,
But these names don't refer to types, so I think you have a valid
point. Consistent naming is a lot of work, but it "looks" better.
In fact, I'd say that base1_type might very well be named
first_argument_type. xor_combine definitely is a binary meta
function and therefore its two arguments are types. It makes sense
to name these arguments first_argument_type and second_argument_type.

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                       ]