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

Repetition of code #1

Open
hiteshsp opened this issue Sep 7, 2016 · 1 comment
Open

Repetition of code #1

hiteshsp opened this issue Sep 7, 2016 · 1 comment

Comments

@hiteshsp
Copy link

hiteshsp commented Sep 7, 2016

primeFactors() method 👍

@geekpradd
Copy link
Owner

It is not repetition. It is called function overloading. Basically if you have a function/method and you have two different data structure types as input you have to repeat the method name for different implementations of that method and C++ will automatically use the correct implementation.

It is certainly not good practice and Templates should be used in Modern C++. But it isn't repetition.

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