From 1ce58ad90aab58bca10af9c448b8e186ac532480 Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sat, 15 Apr 2017 22:02:40 +1000 Subject: Add additional PBD::string_to/to_string specializations for PBD::ID --- libs/pbd/pbd/types_convert.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libs/pbd') diff --git a/libs/pbd/pbd/types_convert.h b/libs/pbd/pbd/types_convert.h index 9a1e3c8461..b0cf7c0884 100644 --- a/libs/pbd/pbd/types_convert.h +++ b/libs/pbd/pbd/types_convert.h @@ -43,6 +43,18 @@ inline bool string_to (const std::string& str, ID& val) return true; } +template <> +inline std::string to_string (ID val) +{ + return val.to_s(); +} + +template <> +inline ID string_to (const std::string& str) +{ + return ID(str); +} + } // namespace PBD #endif // PBD_TYPES_CONVERT_H -- cgit v1.2.3