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

Make dynamic_format_arg_store reusable #1674

Closed
vsolontsov-ll opened this issue May 9, 2020 · 5 comments
Closed

Make dynamic_format_arg_store reusable #1674

vsolontsov-ll opened this issue May 9, 2020 · 5 comments

Comments

@vsolontsov-ll
Copy link
Contributor

It must be easy to make the dynamic_format_arg_store reusable by adding method clear(). Also adding method reserve(num_args, num_named_args) can improve memory management.

@vitaut
Copy link
Contributor

vitaut commented May 9, 2020

PRs are welcome =).

@vsolontsov-ll
Copy link
Contributor Author

Will do. The only trouble - I see no simple way to test reserve() method.

@vitaut
Copy link
Contributor

vitaut commented May 9, 2020

@vsolontsov-ll
Copy link
Contributor Author

Right....:-)
Well, as of now dynamic_format_arg_store<> is not parameterized by allocator. I'm not infected by TDD that much. Do you see a reason for adding allocator there besides testing trivial method?

@vitaut
Copy link
Contributor

vitaut commented May 10, 2020

No, I'm OK not testing whether reserve does anything useful since it's just an optimization and doesn't affect correctness. It's enough to test that it doesn't break things.

vsolontsov-ll added a commit to vsolontsov-ll/fmt that referenced this issue May 11, 2020
vitaut pushed a commit that referenced this issue May 12, 2020
Implemented #1674: make dynamic_format_arg_store reusable and add
reserve() for better memory menagement.
@vitaut vitaut closed this as completed May 12, 2020
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

No branches or pull requests

2 participants