-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adding is_palindromic() algo to Boost.Algorithm #21
base: master
Are you sure you want to change the base?
Conversation
Needs tests ;-) Off the top of my head, it needs tests for: zero element input, single element, odd #, even #. That would be a good start. The tests should exercise both the version that uses operator== and the one that takes a comparison functor explicitly. |
I tested it on tests like that: zero element input, single element, odd and even. Also I tested on set of random strings. Should I add my tests to tests on GitHub? |
Yes. The tests should be part of the pull request. Also, documentation. |
You can get most of the documentation that you want by putting doxygen comments in the source, but you'll have to write a description, rationale, etc. |
in your documentation, there should be "What should you use this for"? (so, real-world examples). |
Can I use in tests C++14? |
I would not if I were you; that would limit the people who run the tests. I don't see anything in the code you have that uses c++14. |
You can't see it - it's not yet in the repo. It's my code for testing(using auto in arguments in lambda). Ok, I'll not use C++14. What about C++11? I think, it's widespread compiler. |
Can you send me your config file for doxygen? Because i don't know about style of Boost's documentation. |
I have done examples, tests and documentation. What should i do next? |
This is looking good. Also, in the docs, you write:
That doesn't really tell the reader anything. I think that this would be better:
(basically insert a definition of what a palindrome is) |
Yes, i agree with your additions. |
I wrote 'is_palindromic' because before aming of function i discuss about this with some other people. And first variant was 'is_palindromic'. But your variant is better, from my point of view. I don't know, why i didn't name function 'is_plaindrome' before your comment. I rewrited name of function in the implementation, examples, tests, documents. Something else? |
Ok; I think this is ready to commit. However, I'll be committing it manually, because this isn't the right place for it. My personal repo is different from the boost one. This should be committed to |
ok. For every next set of features should i create a new feature branch? |
Hello. I implemented is_palindromic() algo for Boost.Algorithm.
The algorithm compares container from two sides. You can use custom comparator. Also supported Boost.Range. Complexity is O(N).
Using is easy: you should give two bidirectional or most powerful iterators for [begin, end) and you may give custom comparator.
Result is bool.
Maybe you have some additions to this algorithm?
Best regards, Zaitsev Alexander.