Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // OLD:
- BeerShelf whatUsedToBeInTheRecycleBin = recycleBin;
- //replace the contents of the recycle bin with our old bottle
- while( !recycleBin.compare_exchange_weak( whatUsedToBeInTheRecycleBin, emptyBottle ) ) {}
- // NEW:
- BeerShelf whatUsedToBeInTheRecycleBin = recycleBin.exchange(emptyBottle);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement