From 92304624e28c8ee78632cea430454d1ccad91e22 Mon Sep 17 00:00:00 2001 From: Mykola Vankovych Date: Mon, 1 Feb 2021 16:10:35 +0100 Subject: [PATCH] adding xt::adapt(xt::sequence_view). --- include/xtensor/xadapt.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/xtensor/xadapt.hpp b/include/xtensor/xadapt.hpp index a79788e09..4608e263b 100644 --- a/include/xtensor/xadapt.hpp +++ b/include/xtensor/xadapt.hpp @@ -403,6 +403,11 @@ namespace xt return adapt(std::forward(ptr), xtl::forward_sequence(shape)); } + template + inline auto adapt(const xt::sequence_view& view) { + return adapt(&view.front(), {view.size()}); + } + /***************************** * smart_ptr adapter builder * *****************************/