On Tue, Sep 1, 2009 at 2:59 AM, Marco Guazzone
On Tue, Sep 1, 2009 at 10:39 AM, OvermindDL1
wrote: I just think of it this way, front() will get the first element in a container, now sometime those containers are linear, like vector or list or cons, but other times they are not linear, then who knows what I may get first, like with set and map. Besides, is it not more proper to use an iterator? I have never personally used front, always use an iterator since I need all elements to test with when using a set/map, only ever used it with vector/list/cons, where it makes sense.
Well, as I said previously, I completely agree with you. I've used front just for trying all mpl::set operations.
But the point is that "front" is defined for sets (and maps) so we and possible future users need a clear definition of its behavior on these data structures, or at least a big-note beside it saying "Please don't use this operation for XXX since it is implementation dependent" where XXX in {"mpl::set", "mpl::map"}
I'm curious what MPL authors think about this.
I am curious too, wonder where they are... ;-)