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

Feature/add back insert iterator #603

Conversation

evantill
Copy link
Contributor

Add back_insert_iterator and back_inserter()

include/etl/iterator.h Outdated Show resolved Hide resolved
include/etl/iterator.h Outdated Show resolved Hide resolved
@jwellbelove
Copy link
Contributor

The all iterator tags should use the ETL_OR_STD namespace.
I think there should be also be a matching etl::back_inserter defined.

There is also the complementary front_insert_iterator & etl::front_inserter in the STL.

- Make back_insert_iterator available to C++03
- Add ETL_CONSTEXPR17,ETL_NODISCARD and ETL_USING_CPP11
- Replace std:move usage by etl::move
- Update doc
@evantill evantill force-pushed the feature/add-back_insert_iterator branch from 4dd67f9 to 5eb8e4f Compare September 19, 2022 20:09
Copy link
Contributor Author

@evantill evantill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions

include/etl/iterator.h Show resolved Hide resolved
include/etl/iterator.h Outdated Show resolved Hide resolved
include/etl/iterator.h Show resolved Hide resolved
@jwellbelove jwellbelove changed the base branch from development to feature/#603-add-back-insert-iterator October 4, 2022 11:02
@jwellbelove jwellbelove merged commit af98e17 into ETLCPP:feature/#603-add-back-insert-iterator Oct 4, 2022
@jwellbelove
Copy link
Contributor

Was there a particular reason that you used ETL_CONSTEXPR17 instead of ETL_CONSTEXPR14?

@evantill
Copy link
Contributor Author

evantill commented Oct 6, 2022

Was there a particular reason that you used ETL_CONSTEXPR17 instead of ETL_CONSTEXPR14?

I can not remember the link but I have adapted the source from the std implementation and the constexpr was added since C++17.

@evantill evantill deleted the feature/add-back_insert_iterator branch October 6, 2022 10:37
jwellbelove pushed a commit that referenced this pull request Oct 20, 2022
* Add back_inserter implementation

- Mainly a copy of the STL implementation found in LLVM.
- Add test_back_insert_iterator unit test.

* Add documentation and use ETL_OR_STD macro

* Add MIT License in header

* Move back_insert_iterator into iterator.h

* Remove unused code

* Strictly follow the C++ STL naming

https://en.cppreference.com/w/cpp/iterator/back_insert_iterator
Strictly following the C++ STL would have container_ be container.

* Make the check for C++11 clearer

* Run the unit test only for C++11

* Add front_insert_iterator

- Make back_insert_iterator available to C++03
- Add ETL_CONSTEXPR17,ETL_NODISCARD and ETL_USING_CPP11
- Replace std:move usage by etl::move
- Update doc

* Use explicit namespace for adressof() and move().
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

Successfully merging this pull request may close these issues.

3 participants