mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-22 01:20:39 +00:00
cql3: add static function to_double to property_definitions
Useful for retrieving a double value from a string. Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
This commit is contained in:
@@ -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<sstring> value, double default_value) {
|
||||
if (value) {
|
||||
auto val = value.value();
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user