diff --git a/src/lib/diff/diff-message.hpp b/src/lib/diff/diff-message.hpp index ab3ed204c..59f28a0ac 100644 --- a/src/lib/diff/diff-message.hpp +++ b/src/lib/diff/diff-message.hpp @@ -51,6 +51,7 @@ #include "lib/iter-source.hpp" #include "lib/diff/tree-diff.hpp" #include "lib/diff/gen-node.hpp" +#include "lib/meta/util.hpp" #include @@ -59,6 +60,11 @@ namespace lib { namespace diff{ using std::string; + using std::__and_; + using std::__not_; + using lib::meta::enable_if; + using lib::meta::can_IterForEach; + using lib::meta::can_STL_ForEach; using DiffStep = TreeDiffLanguage::DiffStep; using DiffSource = IterSource; @@ -86,6 +92,9 @@ namespace diff{ struct DiffMessage : DiffSource::iterator { + using _FrontEnd = DiffSource::iterator; + + DiffMessage() = default; /** @@ -95,7 +104,12 @@ namespace diff{ */ explicit DiffMessage(DiffSource* diffGenerationContext) - : DiffSource::iterator{DiffSource::build (diffGenerationContext)} + : _FrontEnd{DiffSource::build (diffGenerationContext)} + { } + + template + DiffMessage(IT ii, enable_if< can_IterForEach, void*> =nullptr) + : _FrontEnd{iter_source::wrapIter(ii)} { } }; diff --git a/src/lib/iter-adapter.hpp b/src/lib/iter-adapter.hpp index b41dcae2c..b4d824eb9 100644 --- a/src/lib/iter-adapter.hpp +++ b/src/lib/iter-adapter.hpp @@ -249,13 +249,9 @@ namespace lib { protected: using ConRef = typename iter::TypeBinding::reference; - /** allow derived classes to - * access backing container */ - ConRef - source() - { - return source_; - } + /** allow derived classes to access backing container */ + ConRef source() { return source_; } + const ConRef source() const { return unConst(this)->source_; } private: void diff --git a/src/lib/iter-type-binding.hpp b/src/lib/iter-type-binding.hpp index fa48a0083..7ca5c87e3 100644 --- a/src/lib/iter-type-binding.hpp +++ b/src/lib/iter-type-binding.hpp @@ -102,9 +102,9 @@ namespace iter { template struct TypeBinding> { - typedef TY value_type; - typedef const TY& reference; - typedef const TY* pointer; + typedef std::shared_ptr value_type; + typedef std::shared_ptr& reference; + typedef std::shared_ptr* pointer; };