Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rectangles: Move enable_shared_from_this to base
In preparation of making a recursive find_rect() function which will need shared_from_this in the base class, we need to move enable_shared_from_this into the base Rectangle class. CompositeRectangle will still get a type-safe shared_from_this() function using static_pointer_cast, which is safe because CompositeRectangle::shared_from_this is guaranteed to be called with a CompositeRectangle instance.
- Loading branch information
Showing
2 changed files
with
20 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters