Skip to main content

I've decided to implement pythonsPython's any in C++. I've gone about this using templates to allow multiple types of data to be passed, instead of overloading the function multiple times. This is my first time using templates so I would really like feedback about my usage of them. I'm also fairly new with references and pointers, so I would like some criticism about my use of them as well. Of course, anything else is on the table and appreciated.

Note: While writing this program, I realized std::any_of existed. So yes I do know there's already a built-in method for this. While writing this program, I realized std::any_of existed. So yes, I do know there's already a built-in method for this.

Any.hppany.hpp

I've decided to implement pythons any in C++. I've gone about this using templates to allow multiple types of data to be passed, instead of overloading the function multiple times. This is my first time using templates so I would really like feedback about my usage of them. I'm also fairly new with references and pointers, so I would like some criticism about my use of them as well. Of course, anything else is on the table and appreciated.

Note: While writing this program, I realized std::any_of existed. So yes I do know there's already a built-in method for this.

Any.hpp

I've decided to implement Python's any in C++. I've gone about this using templates to allow multiple types of data to be passed, instead of overloading the function multiple times. This is my first time using templates so I would really like feedback about my usage of them. I'm also fairly new with references and pointers, so I would like some criticism about my use of them as well. Of course, anything else is on the table and appreciated.

While writing this program, I realized std::any_of existed. So yes, I do know there's already a built-in method for this.

any.hpp

Any Implementation Implementing any_of in C++

Note: While writing this program, I realized std::any_of existed. Wanting to continue learning and writing this program, I kept going. So yes I do know there's already a built-in method for this.

Any Implementation in C++

Note: While writing this program, I realized std::any_of existed. Wanting to continue learning and writing this program, I kept going. So yes I do know there's already a built-in method for this.

Implementing any_of in C++

Note: While writing this program, I realized std::any_of existed. So yes I do know there's already a built-in method for this.

Tweeted twitter.com/StackCodeReview/status/1242738131113250817
Became Hot Network Question
edited tags
Link
Linny
  • 10.4k
  • 5
  • 37
  • 99
Source Link
Linny
  • 10.4k
  • 5
  • 37
  • 99
Loading