@@ -209,7 +209,8 @@ namespace xt
209209 * @param container the container to adapt
210210 * @param l the layout_type of the xtensor_adaptor
211211 */
212- template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C >
212+ template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C ,
213+ XTL_REQUIRES (std::negation<detail::is_array<std::decay_t <C>>>)>
213214 inline xtensor_adaptor<C, 1, L>
214215 adapt(C&& container, layout_type l = L)
215216 {
@@ -218,6 +219,22 @@ namespace xt
218219 return return_type (std::forward<C>(container), shape, l);
219220 }
220221
222+ /* *
223+ * Constructs a 1-D xtensor_adaptor of the given stl-like container,
224+ * with the specified layout_type.
225+ * @param container the container to adapt
226+ * @param l the layout_type of the xtensor_adaptor
227+ */
228+ template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C ,
229+ XTL_REQUIRES (detail::is_array<std::decay_t <C>>)>
230+ inline auto
231+ adapt(C&& container)
232+ {
233+ // const std::array<typename std::decay_t<C>::size_type, 1> shape{container.size()};
234+ using return_type = xfixed_adaptor<xtl::closure_type_t <C>, fixed_shape<std::tuple_size<std::decay_t <C>>::value>, L>;
235+ return return_type (std::forward<C>(container));
236+ }
237+
221238 /* *
222239 * Constructs an xtensor_adaptor of the given stl-like container,
223240 * with the specified shape and layout_type.
0 commit comments