[v3] extern/fixed-memory/archive allocator
Benjamin Kosnik
bkoz@redhat.com
Wed Sep 29 16:32:00 GMT 2004
> template<class T, int N = 1>
> struct aligned_storage;
>
>provides a suitably aligned contiguous storage to store N objects of
>type T.
...tis indeed this exactly.
>The obvious implementation with non-broken g++ would be
>
> template<class T, int N>
> struct aligned_storage {
> typedef unsigned char byte;
> typedef byte store[N * sizeof(T)];
> store storage;
>
> byte& operator[](int i) { return storage[i]; }
> const byte& operator[](int i) const { return storage[i]; }
>
> operator void*() { return storage; }
> operator const void*() const { return storage; }
> };
Consider naming issues resolved.... :)
I've asked Mark about the other issues. Hopefully he will add something.
Shouldn't this be in bugzilla?
-benjamin
More information about the Libstdc++
mailing list