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

Update "hello world" translation test to comply with C++ standards #13

Open
Konard opened this issue Dec 14, 2019 · 4 comments
Open

Update "hello world" translation test to comply with C++ standards #13

Konard opened this issue Dec 14, 2019 · 4 comments

Comments

@Konard
Copy link
Member

Konard commented Dec 14, 2019

No description provided.

@Konard Konard changed the title Update hello world translation test to comply C++ standards Update "hello world" translation test to comply C++ standards Dec 14, 2019
@Konard Konard changed the title Update "hello world" translation test to comply C++ standards Update "hello world" translation test to comply with C++ standards Dec 14, 2019
@uselessgoddess
Copy link
Member

uselessgoddess commented Jul 17, 2021

This is the norm

old C-style:

int main(int argc, char** argv)
{
    Work();
}

modern C++-style:

class Program 
{
public:
    void Main(std::vector<std::string> args)
    {
        Work();
    }
}

int main(int argc, char* argv[])
{
    Program program{};
    try 
    {
        program.Main(std::vector<std::string>(argv + 1, argv + argc))
    }
    catch(...)
    {
        HandleException(...);
    }
}

@Konard
Copy link
Member Author

Konard commented Jul 17, 2021

@uselessgoddess where did you find this example?

@uselessgoddess
Copy link
Member

uselessgoddess commented Jul 17, 2021

From a comic post of one popularly company
https://habr.com/en/company/intel/blog/156863/

@Konard
Copy link
Member Author

Konard commented Jul 17, 2021

From a comic post of one popularly company
https://habr.com/en/company/intel/blog/156863/

I didn't find such example there.

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

No branches or pull requests

2 participants