summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2017-04-15 22:02:40 +1000
committerTim Mayberry <mojofunk@gmail.com>2017-04-19 09:37:02 +1000
commit1ce58ad90aab58bca10af9c448b8e186ac532480 (patch)
tree28aab09ba04cebf9f55110b90867020641808a9d /libs/pbd
parentbaa1bff5ec56f3866987b0c0c42f580b7075807e (diff)
Add additional PBD::string_to/to_string specializations for PBD::ID
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/pbd/types_convert.h12
1 files changed, 12 insertions, 0 deletions
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