diff --git a/src/base/str.hh b/src/base/str.hh index 52ab977fc5..61022bd26e 100644 --- a/src/base/str.hh +++ b/src/base/str.hh @@ -1,4 +1,7 @@ /* + * Copyright (c) 2018 ARM Limited + * All rights reserved + * * Copyright (c) 2001-2005 The Regents of The University of Michigan * All rights reserved. * @@ -102,10 +105,11 @@ tokenize(std::vector &vector, const std::string &s, * @{ * * @name String to number helper functions for signed and unsigned - * integeral type, as well as floating-point types. + * integeral type, as well as enums and floating-point types. */ template -typename std::enable_if::value && +typename std::enable_if<(std::is_integral::value || + std::is_enum::value) && std::is_signed::value, T>::type __to_number(const std::string &value) { @@ -117,7 +121,8 @@ __to_number(const std::string &value) } template -typename std::enable_if::value && +typename std::enable_if<(std::is_integral::value || + std::is_enum::value) && !std::is_signed::value, T>::type __to_number(const std::string &value) {