Introduce Bool Type#492
Conversation
Previously the library implicitly converted bool columns to `Uint8`, loosing type information. This commit introduces a "strong type" for `Bool` that is distinct from `bool`. This allows complete re-use of `ColumnVector` without triggering the `std::vector<bool>` specialization. This new type is guarded behind a CMake variable/preprocessor define `CH_MAP_BOOL_TO_UINT8`, which is enabled by default in order to keep compatibility for library users. In the future the default should be switched first and the variable then removed later.
a0c98cd to
95bc002
Compare
|
@IyeOnline, I think I’m missing something here, but how am I supposed to use it for inserting values? The obvious way of using the actual type doesn’t look right to me: This doesn’t look any better either: I was wondering whether you considered simply subclassing |
|
@slabko You can do I only tested getting values out on my side (because thats what I need it for) and there the I did think about sub-classing a uint8 column originally as a means of having seamless compatibility but discarded that idea as it would still clash with the Further, I think for correctness you would want the ColumnBool to only privately inherit But looking at the |
Previously the library implicitly converted bool columns to
Uint8,loosing type information.
This commit introduces a "strong type" for
Boolthat is distinct frombool. This allows complete re-use ofColumnVectorwithout triggeringthe
std::vector<bool>specialization.This new type is guarded behind a CMake variable/preprocessor define
CH_MAP_BOOL_TO_UINT8, which is enabled by default in order to keepcompatibility for library users. In the future the default should be
switched first and the variable then removed later.