diff options
Diffstat (limited to 'support')
-rw-r--r-- | support/StringSupport.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/support/StringSupport.h b/support/StringSupport.h index 5e237c7dff..e8b3ca7ab3 100644 --- a/support/StringSupport.h +++ b/support/StringSupport.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 Arm Limited. + * Copyright (c) 2017-2022 Arm Limited. * * SPDX-License-Identifier: MIT * @@ -131,6 +131,12 @@ inline std::string to_string(T && value) return stream.str(); } +// Specialization for const std::string& +inline std::string to_string(const std::string &value) +{ + return value; +} + /** Convert string values to float. * * @note This function implements the same behaviour as std::stof. The latter @@ -164,6 +170,12 @@ inline std::string to_string(T &&value) return ::std::to_string(std::forward<T>(value)); } +// Specialization for const std::string& +inline std::string to_string(const std::string &value) +{ + return value; +} + /** Convert string values to float. * * @note This function acts as a convenience wrapper around std::stof. The |