Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- copy_on_write<std::vector<EnvelopePoint>> envelope1;
- envelope1.write().push_back(EnvelopePoint(0.0,1.0));
- envelope1.write().push_back(EnvelopePoint(1.0,0.0));
- std::vector<copy_on_write<std::vector<EnvelopePoint>>> copies;
- for (int i=0;i<1000000;i++) // some tests i've done actually involve a million HourGlass envelopes and it seems to work fine
- {
- copies.push_back(envelope1);
- }
- // from the 5000th copy of the envelope, read second point's time position
- qDebug() << copies[5000].read()[1].TimePosition();
- // change time position of the first node of the 999999th copy of the envelope
- copies[999998].write()[0].setTimePosition(0.13);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement