Skip to content

Improved GetMany test for C++/WinRT#499

Merged
kennykerr merged 3 commits into
masterfrom
kennykerr-GetMany-generator
Jul 9, 2019
Merged

Improved GetMany test for C++/WinRT#499
kennykerr merged 3 commits into
masterfrom
kennykerr-GetMany-generator

Conversation

@kennykerr

Copy link
Copy Markdown
Contributor

Updated the test to use an iterator that may only be advanced once, ensuring the GetMany complexity optimization is actually enforced with this test. This updates #497

};

return make<list>(std::move(values));
auto v = single_threaded_vector<T>(std::move(values));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add the ability to do this for a container that is definitely not random-access, like std::list.

@kennykerr kennykerr Jul 8, 2019

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's what generator_container ensures as it only offers an IIterator<T>. I initially used std::list alone and while that ensures that random access is not available, it doesn't ensure that multiple traversals aren't employed. Here a vector is used merely for convenience to create the container that the forward-only WinRT iterator is backed by.

@kennykerr kennykerr merged commit ad87f23 into master Jul 9, 2019
@kennykerr kennykerr deleted the kennykerr-GetMany-generator branch July 9, 2019 18:21
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