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

it->first/second are always const #20

Open
glebm opened this issue Aug 11, 2022 · 1 comment
Open

it->first/second are always const #20

glebm opened this issue Aug 11, 2022 · 1 comment

Comments

@glebm
Copy link
Contributor

glebm commented Aug 11, 2022

In tsl::sparse_map, iterator->first/second result is always const regardless of the underlying constness.
This is different from std::unordered_map, where iterator->first/second result is const only if the map is const.

This is documented in README.md but there doesn't seem to be anything making this impossible in principle.

glebm added a commit to glebm/devilutionX that referenced this issue Aug 11, 2022
A couple of minor changes are needed to work around constness issues
in tsl::sparse_map:

1. Tessil/sparse-map#20
2. Tessil/sparse-map#21
glebm added a commit to glebm/devilutionX that referenced this issue Jan 16, 2023
A couple of minor changes are needed to work around constness issues
in tsl::sparse_map:

1. Tessil/sparse-map#20
2. Tessil/sparse-map#21

Memory savings example, Spanish translations map:
296 KiB -> 263 KiB (-33 KiB)

RG99 binary size: +36 KiB
@firedtoad
Copy link

I commit a pull request to fix this problem please review it sooner

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