A
abir
Hi,
I have one specific purpose container, where it stores struct elem in
contiguous memory as,
elem* buffer_;
the struct elem is
struct elem{
size_type index;
value_type value;
key_type key;
};
where types are of usual meaning.
i am interested to have one operator value_type& operator[](size_type
i), rather than the usual
elem& operator[](size_type i);
can anyone give a direction how i can cast buffer_ to value_type in
portable way? i.e irrespective of alignments etc.
or if i make value_type value as the first in order, will it work ?
thanks
abir
I have one specific purpose container, where it stores struct elem in
contiguous memory as,
elem* buffer_;
the struct elem is
struct elem{
size_type index;
value_type value;
key_type key;
};
where types are of usual meaning.
i am interested to have one operator value_type& operator[](size_type
i), rather than the usual
elem& operator[](size_type i);
can anyone give a direction how i can cast buffer_ to value_type in
portable way? i.e irrespective of alignments etc.
or if i make value_type value as the first in order, will it work ?
thanks
abir