Hi, I've noticed that creating const_map instances is not particularly easy. This is partly due to the need to repeat types a lot, and partly due to the fact that if the backing array is not sorted already, the map doesn't work. See here for more details: #1306
Ideally, we could get a new etl::make_const_map function that accepts an initializer list, and then would deduce all the needed types and sort the K-V pairs before creating the map. Also, we should probably add a note in the docs that etl::const_map requires a pre-sorted array, and a static assert that verifies this is the case so the user doesn't get unexpected behavior.
Thanks for taking a look at this!
Hi, I've noticed that creating const_map instances is not particularly easy. This is partly due to the need to repeat types a lot, and partly due to the fact that if the backing array is not sorted already, the map doesn't work. See here for more details: #1306
Ideally, we could get a new
etl::make_const_mapfunction that accepts an initializer list, and then would deduce all the needed types and sort the K-V pairs before creating the map. Also, we should probably add a note in the docs that etl::const_map requires a pre-sorted array, and a static assert that verifies this is the case so the user doesn't get unexpected behavior.Thanks for taking a look at this!