mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
added example to C.136
This commit is contained in:
parent
13d6eff946
commit
45e11be0ad
|
@ -6447,7 +6447,6 @@ To make this interface useful, we must provide its implementation classes (here,
|
|||
Now `Shape` is a poor example of a class with an implementation,
|
||||
but bear with us because this is just a simple example of a technique aimed at more complex hierarchies.
|
||||
|
||||
|
||||
class Impl::Circle : public Circle, public Impl::Shape { // implementation
|
||||
public:
|
||||
// constructors, destructor
|
||||
|
@ -6697,6 +6696,13 @@ If the operations are virtual the use of inheritance is necessary, if not using
|
|||
|
||||
This a relatively rare use because implementation can often be organized into a single-rooted hierarchy.
|
||||
|
||||
##### Example
|
||||
|
||||
Sometimes, an "implementation attribute" is more like a "mixin" that determine the behavior of an implementation and inject
|
||||
members to enable the implementation of the policies it requires.
|
||||
For example, see `std::enable_shared_from_this`
|
||||
or various bases from boost.intrusive (e.g. `list_base_hook` or `intrusive_ref_counter`).
|
||||
|
||||
##### Enforcement
|
||||
|
||||
???
|
||||
|
|
Loading…
Reference in New Issue
Block a user