delete copy ctor and copy assgin for BuilderPattern
parent
990e1a53fd
commit
d4d7abc3ec
|
@ -38,6 +38,8 @@ public:
|
||||||
AbstractBuilder() {
|
AbstractBuilder() {
|
||||||
house = new House();
|
house = new House();
|
||||||
}
|
}
|
||||||
|
AbstractBuilder(const AbstractBuilder& o) = delete;
|
||||||
|
AbstractBuilder& operator=(const AbstractBuilder& o) = delete;
|
||||||
virtual ~AbstractBuilder()
|
virtual ~AbstractBuilder()
|
||||||
{
|
{
|
||||||
if (house != nullptr)
|
if (house != nullptr)
|
||||||
|
@ -62,6 +64,8 @@ public:
|
||||||
ConcreteBuilderA() {
|
ConcreteBuilderA() {
|
||||||
printf("ConcreteBuilderA\n");
|
printf("ConcreteBuilderA\n");
|
||||||
}
|
}
|
||||||
|
ConcreteBuilderA(const ConcreteBuilderA& o) = delete;
|
||||||
|
ConcreteBuilderA& operator=(const ConcreteBuilderA& o) = delete;
|
||||||
~ConcreteBuilderA()
|
~ConcreteBuilderA()
|
||||||
{
|
{
|
||||||
if (this->house != nullptr)
|
if (this->house != nullptr)
|
||||||
|
@ -92,7 +96,9 @@ public:
|
||||||
ConcreteBuilderB() {
|
ConcreteBuilderB() {
|
||||||
printf("ConcreteBuilderB\n");
|
printf("ConcreteBuilderB\n");
|
||||||
}
|
}
|
||||||
~ConcreteBuilderA()
|
ConcreteBuilderB(const ConcreteBuilderB&) = delete;
|
||||||
|
ConcreteBuilderB& operator=(const ConcreteBuilderB&) = delete;
|
||||||
|
~ConcreteBuilderB()
|
||||||
{
|
{
|
||||||
if (this->house != nullptr)
|
if (this->house != nullptr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue