From e3d3d9be71a51ec784eace8d9d866c91ddb7c6d4 Mon Sep 17 00:00:00 2001 From: "Raphael S. Carvalho" Date: Thu, 23 Jul 2015 14:42:15 -0300 Subject: [PATCH] cql3: add static function to_double to property_definitions Useful for retrieving a double value from a string. Signed-off-by: Raphael S. Carvalho --- cql3/statements/property_definitions.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cql3/statements/property_definitions.hh b/cql3/statements/property_definitions.hh index 6bbbe43528..5534fd9338 100644 --- a/cql3/statements/property_definitions.hh +++ b/cql3/statements/property_definitions.hh @@ -137,6 +137,10 @@ public: // Return a property value, typed as a double double get_double(sstring key, double default_value) const { auto value = get_simple(key); + return to_double(key, value, default_value); + } + + static double to_double(sstring key, std::experimental::optional value, double default_value) { if (value) { auto val = value.value(); try {