This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: hashtable local iterator


On 20 December 2011 20:38, François Dumont wrote:
> Thanks for the proposition but it was not exactly what I needed. In fact I
> have this kind of use case:
>
> struct A1
> {};
>
> struct A2
> {};
>
> struct A3
> {};
>
> struct B
> {
> ?A1 m_a1;
> ?A2 m_a2;
> ?A3 m_a3;
> };
>
> struct C : B
> {
> ?size_t m_size;
> };
>
> and I would like to have sizeof(C) == sizeof(size_t). I don't think tuple
> can do anything for me here. Only having B inheriting from A1, A2 and A3
> will give the expected result.

But you control B and C, right?

struct C
{
 std::tuple<B, A1, A2, A3, size_t> a;
};

sizeof(C) is sizeof(size_t)

(I haven't been following the details fully, so Im not sure what B, An
etc, realy are.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]