Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use goo[gle]d C++ #57

Open
uselessgoddess opened this issue Jul 5, 2021 · 2 comments
Open

Use goo[gle]d C++ #57

uselessgoddess opened this issue Jul 5, 2021 · 2 comments
Labels
good first issue Good for newcomers

Comments

@uselessgoddess
Copy link
Member

Check this links and fixes translator
always use explicit constructor
always use explicit operator conversions

bonus:
use next structure to translate constructors

public: constructor(integral_type a, non_integral_type b) noexcept ( /* if body is empty */ )
    : a(a), b(std::move(b)) // or _a(a), _b(std::move(b))
{
}
@uselessgoddess uselessgoddess added the good first issue Good for newcomers label Jul 5, 2021
@Konard
Copy link
Member

Konard commented Jul 22, 2021

We have C# code that relies on implicit operator conversions.
Maybe we should make a decision about operator conversions in a different issue?

I agree that we can use explicit constructors.

@uselessgoddess
Copy link
Member Author

This does not affect the result. It is better to abandon implicit operators
In C++, this can be dangerous

Constructors and operators are very similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants