rhalbersma / bit_set

Rebooting the std::bitset franchise
Boost Software License 1.0
40 stars 5 forks source link

Make the proxy_reference conversion operator a template #3

Closed rhalbersma closed 6 years ago

rhalbersma commented 6 years ago

Use std::enable_if_t<std::is_constructible_v<T, value_type>> to convert to any type that can be implicitly constructed from an int (which is the value_type of int_set<N>::proxy_reference).

Rationale: this allows assignment-from int_set<N> to any container with int-constructible types (similar as to how this works for std::set<int>). Assignment-to will not work. Also update the example in the README.