From 4c7480ce3bbee83af176d1d8e802f768f2f409e6 Mon Sep 17 00:00:00 2001 From: Tomasz Grabiec Date: Wed, 4 Mar 2015 17:50:11 +0100 Subject: [PATCH] cql3: Introduce to_identifier(column_definition&) --- cql3/column_identifier.hh | 7 ++++++- tuple.hh | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cql3/column_identifier.hh b/cql3/column_identifier.hh index 7550fbae72..f493d120b7 100644 --- a/cql3/column_identifier.hh +++ b/cql3/column_identifier.hh @@ -180,12 +180,17 @@ column_definition* get_column_definition(schema_ptr schema, column_identifier& i return schema->get_column_definition(id.bytes_); } +static inline +::shared_ptr to_identifier(const column_definition& def) { + return def.column_specification->name; +} + static inline std::vector<::shared_ptr> to_identifiers(const std::vector& defs) { std::vector<::shared_ptr> r; r.reserve(defs.size()); for (auto&& def : defs) { - r.push_back(def->column_specification->name); + r.push_back(to_identifier(*def)); } return r; } diff --git a/tuple.hh b/tuple.hh index 0d1ce4ede6..7a221cbeb6 100644 --- a/tuple.hh +++ b/tuple.hh @@ -34,6 +34,8 @@ public: })) { } + tuple_type(tuple_type&&) = default; + prefix_type as_prefix() { return prefix_type(_types); }