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

forward_as_tuple not working as expected #142

Open
Mogball opened this issue Jun 7, 2018 · 0 comments
Open

forward_as_tuple not working as expected #142

Mogball opened this issue Jun 7, 2018 · 0 comments
Labels

Comments

@Mogball
Copy link
Contributor

Mogball commented Jun 7, 2018

The current code for map insert is

template<typename K, typename V>
pair<iterator, bool> insert(K &&key, V &&val) 
{ return m_table.insert_unique(make_tuple(forward<K>(key), forward<V>(val))); }

but if you replace it with

return m_table.insert_unique(forward_as_tuple(key, val));

insertion will create duplicates for dynamic types like dynamic_string

@Mogball Mogball added the bug label Jun 7, 2018
@Mogball Mogball changed the title forward_as_tuple not working as expected forward_as_tuple not working as expected Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant