base: Fix enums checkpointing

Creating an extra version of string to number converters (__to_number)
in base/str.hh; it will be used by enums only when unserializing
them.  The reason not to have a single helper for both enums and
integers is that std::numeric_limits trait is not specialized for enums.
We fix this by using the std::underlying_type trait.

Change-Id: I819e35c0df8c094de7b7a6390152964fa47d513d
Signed-off-by: Giacomo Travaglini <>
Reviewed-by: Ciro Santilli <>
Signed-off-by: Giacomo Travaglini <>
Reviewed-by: Daniel Carvalho <>
Reviewed-by: Andreas Sandberg <>
Maintainer: Jason Lowe-Power <>
1 file changed