From c108a78b3523db990ba9f1554ea61abca50ff4f8 Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Fri, 13 May 2016 18:50:49 -0500 Subject: [PATCH 1/2] Resove #651: Make add_secondary_index return index A pointer to the newly created index object is now returned. --- libraries/db/include/graphene/db/index.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/db/include/graphene/db/index.hpp b/libraries/db/include/graphene/db/index.hpp index 7ecf5a66..1a33185c 100644 --- a/libraries/db/include/graphene/db/index.hpp +++ b/libraries/db/include/graphene/db/index.hpp @@ -168,6 +168,7 @@ namespace graphene { namespace db { void add_secondary_index() { _sindex.emplace_back( new T() ); + return static_cast(_sindex.back().get()); } template From dc9e0fa02550acbaf1a075c3aa685965ba27a5d4 Mon Sep 17 00:00:00 2001 From: Nathan Hourt Date: Mon, 16 May 2016 14:12:57 -0500 Subject: [PATCH 2/2] Fix index.hpp Bad return type. --- libraries/db/include/graphene/db/index.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/db/include/graphene/db/index.hpp b/libraries/db/include/graphene/db/index.hpp index 1a33185c..aebdb8b9 100644 --- a/libraries/db/include/graphene/db/index.hpp +++ b/libraries/db/include/graphene/db/index.hpp @@ -165,7 +165,7 @@ namespace graphene { namespace db { void on_modify( const object& obj ); template - void add_secondary_index() + T* add_secondary_index() { _sindex.emplace_back( new T() ); return static_cast(_sindex.back().get());