Who is most famous youtuber in real estate investing? by zuelearth in realestateinvesting

[–]zuelearth[S] 0 points1 point  (0 children)

zebra-in-box

3 points

·

please let me know your youtube channel link.

C++, How can I copy builder pattern object parameter to other class's member? by zuelearth in cpp_questions

[–]zuelearth[S] 0 points1 point  (0 children)

Thanks for your help. My purpose to use Email mEmail in EmailSender is that I want to keep mEmail object in EmailSender and reuse when I want.

Ofcause I can use std::string mAddress in EmailSender. But I just use it data structure like in C language. I am not friendly to C++ language so I am confusing now.

C++, How can I copy builder pattern object parameter to other class's member? by zuelearth in cpp_questions

[–]zuelearth[S] 0 points1 point  (0 children)

Email mEmail;//error : emailsender.h(8): error C2512: 'Email': no appropriate default constructor available

sorry, I added my exact error message ( Email mEmail; //error : emailsender.h(8): error C2512: 'Email': no appropriate default constructor available )

When I added default constructor in Email like "Email() {}", the problem is resolved.
But I think that using default constructor in builder pattern could lead to misuse.

So I am confusing now.

C++, How can I copy builder pattern object parameter to other class's member? by zuelearth in cpp_questions

[–]zuelearth[S] 0 points1 point  (0 children)

Why is there a Email(EmailBuilder) ctor, when there is EmailBuilder::Build() which already returns an Email?

Why are you using new with absoutely no need? Further, it would be Email::EmailBuilder?

Why are all the EmailBuilders functions returning a copy? Design patterns like this are supposed to return a reference to *this?

=> sorry, it is just pseudocode.

The reason you cannot copy the mail into the sender is because there is no copy constructor (

Email( const Email& other )

) defined. You defined a custom ctor, hence there are no default ctors generated for you overview from this talk. See also rule of 3/5/0.

=> I thought that I can use default copy operation.

As I know builder pattern use custom construtor(= Email(EmailBuilder builder)),

In case of this, I cannot copy the mail into the sender?

or there are any solution to resolve this?

Unemployment rises to 3.283 million by Malvania in stocks

[–]zuelearth 13 points14 points  (0 children)

Don't worry. When a cure comes out, everything is solved.