Skip to content

Add support for other types than just vector#15

Merged
jesperkdab merged 1 commit intomainfrom
wip/support-maps
Oct 11, 2022
Merged

Add support for other types than just vector#15
jesperkdab merged 1 commit intomainfrom
wip/support-maps

Conversation

@jesperkdab
Copy link
Copy Markdown
Collaborator

For example filtered or transformed on a map or a set

Pending are support for QHash and QMap.

@jesperkdab jesperkdab requested a review from dangelog September 13, 2022 19:07
Comment thread src/bits/insert_wrapper.h Outdated
Comment thread src/bits/insert_wrapper.h Outdated
Comment thread README.md Outdated
Comment thread README.md
Comment thread src/bits/insert_wrapper_qt.h Outdated
Comment thread src/bits/insert_wrapper_qt.h Outdated
Comment thread tests/tst_kdalgorithms.cpp
Comment thread README.md
Comment thread src/bits/insert_wrapper.h Outdated
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
Copy link
Copy Markdown

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
Comment thread README.md Outdated

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

Choose a reason for hiding this comment

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

Nag: too many &

Comment thread src/bits/insert_wrapper.h Outdated
template <typename Container>
auto insert_wrapper(
Container &c,
std::enable_if_t<std::experimental::is_detected_v<has_push_back, Container,
Copy link
Copy Markdown

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.

2 participants