
26 Feb
2007
26 Feb
'07
9:33 p.m.
Matias Capeletto wrote:
On 2/26/07, Thorsten Ottosen <thorsten.ottosen@dezide.com> wrote:
What if you make the members of the view pairs something like
template< class Pair& > struct get_first { Pair& p_; operator typename Pair::first_type&() const { return p_.first; } };
?
It is a possible way to achieve the same results. The problem with it is that the size of the resulting pair will be two references bigger. This option was analyze and discarded for that reason.
Not understood. A pair of references pair<T&,U&> requires one to store 2 references. My skecth above would also require 2 references. A smart compiler might know it is the same reference store twice snd do some optimization. -Thorsten