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

boolean value is not supported #36

Open
vigsterkr opened this issue Feb 10, 2021 · 1 comment
Open

boolean value is not supported #36

vigsterkr opened this issue Feb 10, 2021 · 1 comment

Comments

@vigsterkr
Copy link

when creating a tsl::htrie_map<char, bool> and trying to insert or emplace an element i'm getting the following error:

array_hash.h:870:14: error: non-const lvalue reference to type 'bool' cannot bind to a temporary of type
      'std::__1::vector<bool, std::__1::allocator<bool> >::reference' (aka '__bit_reference<std::__1::vector<bool, std::__1::allocator<bool> > >')
      return this->m_array_hash->m_values[value_position()];
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

probably this is due to the difference of implementation of a bitvector, see std::vector<bool>

@Tessil
Copy link
Owner

Tessil commented Jul 4, 2021

Sorry for the late reply.

It's effectively due to the usage of std::vector<T> in the array-hash project. I have to check if I could swap it with a std::deque<T>. I mainly used std::vector<T> to be able to use reserve so that I can then safely move noexcept values without triggering a potential exception.

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