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

Add support for other types than just vector #15

Merged
merged 1 commit into from
Oct 11, 2022
Merged

Conversation

jesperkdab
Copy link
Collaborator

For example filtered or transformed on a map or a set

Pending are support for QHash and QMap.

src/bits/insert_wrapper.h Outdated Show resolved Hide resolved
src/bits/insert_wrapper.h Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
src/bits/insert_wrapper_qt.h Outdated Show resolved Hide resolved
src/bits/insert_wrapper_qt.h Outdated Show resolved Hide resolved
tests/tst_kdalgorithms.cpp Show resolved Hide resolved
README.md Show resolved Hide resolved
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>

Choose a reason for hiding this comment

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

You can drop all these includes?

Also you shouldn't be including experimental traits...

@jesperkdab jesperkdab force-pushed the wip/support-maps branch 2 times, most recently from 3c15123 to 118f4ba Compare September 29, 2022 20:38
README.md Outdated

```
std::map<int, std::string> map{{1, "abc"}, {2, "def"}, {3, "hij"}, {4, "klm"}};
auto doubleKeys = [](const auto& &item) {
Copy link

Choose a reason for hiding this comment

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

Nag: too many &

template <typename Container>
auto insert_wrapper(
Container &c,
std::enable_if_t<std::experimental::is_detected_v<has_push_back, Container,
Copy link

Choose a reason for hiding this comment

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

This is correct and everything, but I'm not sure that you should be using <experimental> stuff, I'm not even sure which compiler(s) have it.

If you need is_detected, that's reimplementable in just a few lines of code.

For example filtered or transformed on a map or a set

Pending are support for QHash and QMap.
@jesperkdab jesperkdab merged commit e2beaad into main Oct 11, 2022
@jesperkdab jesperkdab deleted the wip/support-maps branch October 11, 2022 05:53
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.

None yet

2 participants