Both are quite rare use case in my view. Xor maps would have, instead of a contain method, have a get method to get the stored data. Supporting these features would probably require to rewrite most of the code in the form of pre-processor statements. The advantage is, it would reduce code duplication. It would be harder to read and debug, but running the pre-processor could be a separate build phase, which generates the source code for xor_8, xor_16, xor_32, as well as xor_map_8, xor_map_16, xor_map_32, xor_map_64.