|
Boost : |
Subject: Re: [boost] Proposal: Monotonic Containers
From: Christian Schladetsch (christian.schladetsch_at_[hidden])
Date: 2009-06-09 23:50:14
In fact, I just did a test.
void test_copy()
{
boost::monotonic::inline_storage<1000*sizeof(int)> storage;
boost::monotonic::vector<int> v1(storage);
for (int n = 0; n < 100; ++n)
v1.push_back(n);
size_t rem1 = storage.remaining();
boost::monotonic::vector<int> v2(v1);
size_t rem2 = storage.remaining();
assert(v2 == v1);
assert(rem1 - rem2 == 100*sizeof(int));
}
The interesting thing is that stepping-through the assignment in Visual
Studio had no source-code. It was entirely moved inline and was performed in
one step, even in a debug build.
On Wed, Jun 10, 2009 at 3:33 PM, Christian Schladetsch <
christian.schladetsch_at_[hidden]> wrote:
>
> Where does the copy constructor get the new storage from?
>
>
> From the source object.
>
>
>> --
>> Cory Nelson
>> http://int64.org
>> _______________________________________________
>> Unsubscribe & other changes:
>> http://lists.boost.org/mailman/listinfo.cgi/boost
>>
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk