N
Noah Roberts
Peter said:Noah Roberts said:Peter Olcott wrotew_elem_type* operator[]( t_Size i_index ) {
return & ( m_data[ i_index * m_columns ] );
}
You should at the least have a typedef for this return in order to
abstractify what you are returning. You don't need to know that you
are getting an elem_type* only that you can retrieve a reference to an
elem_type through [] on the returned data item.
I have no idea what you are talking about. You get a pointer to whatever type
formed the parameter to the template. Why is this not perfect the way that it
is?
I'll answer that question by asking another....why do you think
std::vector (for example, all of them do) has a "reference_type"
typedef embedded in the class and returns that instead of value_type&
even though they are quite often the same thing?