@@ -48,7 +48,7 @@ namespace xt
4848 using default_allocator_for_ptr_t = typename default_allocator_for_ptr<P>::type;
4949
5050 template <class T >
51- using not_an_array = xtl::negation<is_array <T>>;
51+ using has_dynamic_size = xtl::negation<has_fixed_size <T>>;
5252
5353 template <class T >
5454 using not_a_pointer = xtl::negation<std::is_pointer<T>>;
@@ -71,8 +71,8 @@ namespace xt
7171 * @param l the layout_type of the xarray_adaptor
7272 */
7373 template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C , class SC ,
74- XTL_REQUIRES (detail::not_an_array <std::decay_t <SC>>,
75- detail::not_a_pointer<C >)>
74+ XTL_REQUIRES (detail::has_dynamic_size <std::decay_t <SC>>,
75+ detail::not_a_pointer<std:: remove_reference_t <C> >)>
7676 inline xarray_adaptor<xtl::closure_type_t<C>, L, std::decay_t<SC>>
7777 adapt(C&& container, const SC& shape, layout_type l = L)
7878 {
@@ -88,7 +88,7 @@ namespace xt
8888 * @param l the layout_type of the xarray_adaptor
8989 */
9090 template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C , class SC ,
91- XTL_REQUIRES (detail::not_an_array <std::decay_t <SC>>,
91+ XTL_REQUIRES (detail::has_dynamic_size <std::decay_t <SC>>,
9292 std::is_pointer<std::remove_reference_t <C>>)>
9393 inline auto adapt(C&& pointer, const SC& shape, layout_type l = L)
9494 {
@@ -107,7 +107,7 @@ namespace xt
107107 * @param strides the strides of the xarray_adaptor
108108 */
109109 template <class C , class SC , class SS ,
110- XTL_REQUIRES (detail::not_an_array <std::decay_t <SC>>,
110+ XTL_REQUIRES (detail::has_dynamic_size <std::decay_t <SC>>,
111111 detail::not_a_layout<std::decay_t <SS>>)>
112112 inline xarray_adaptor<xtl::closure_type_t<C>, layout_type::dynamic, std::decay_t<SC>>
113113 adapt(C&& container, SC&& shape, SS&& strides)
@@ -131,7 +131,7 @@ namespace xt
131131 * @param alloc the allocator used for allocating / deallocating the dynamic array
132132 */
133133 template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class P , class O , class SC , class A = detail::default_allocator_for_ptr_t <P>,
134- XTL_REQUIRES (detail::not_an_array <std::decay_t <SC>>)>
134+ XTL_REQUIRES (detail::has_dynamic_size <std::decay_t <SC>>)>
135135 inline xarray_adaptor<xbuffer_adaptor<xtl::closure_type_t<P>, O, A>, L, SC>
136136 adapt(P&& pointer, typename A::size_type size, O ownership, const SC& shape, layout_type l = L, const A& alloc = A())
137137 {
@@ -155,7 +155,7 @@ namespace xt
155155 * @param alloc the allocator used for allocating / deallocating the dynamic array
156156 */
157157 template <class P , class O , class SC , class SS , class A = detail::default_allocator_for_ptr_t <P>,
158- XTL_REQUIRES (detail::not_an_array <std::decay_t <SC>>,
158+ XTL_REQUIRES (detail::has_dynamic_size <std::decay_t <SC>>,
159159 detail::not_a_layout<std::decay_t <SS>>)>
160160 inline xarray_adaptor<xbuffer_adaptor<xtl::closure_type_t<P>, O, A>, layout_type::dynamic, std::decay_t<SC>>
161161 adapt(P&& pointer, typename A::size_type size, O ownership, SC&& shape, SS&& strides, const A& alloc = A())
@@ -178,7 +178,7 @@ namespace xt
178178 * @param l the layout_type of the xarray_adaptor
179179 */
180180 template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class T , std::size_t N, class SC ,
181- XTL_REQUIRES (detail::not_an_array <std::decay_t <SC>>)>
181+ XTL_REQUIRES (detail::has_dynamic_size <std::decay_t <SC>>)>
182182 inline auto adapt(T (&c_array)[N], const SC& shape, layout_type l = L)
183183 {
184184 return adapt (&c_array[0 ], N, xt::no_ownership (), shape, l);
@@ -192,7 +192,7 @@ namespace xt
192192 * @param strides the strides of the xarray_adaptor
193193 */
194194 template <class T , std::size_t N, class SC , class SS ,
195- XTL_REQUIRES (detail::not_an_array <std::decay_t <SC>>,
195+ XTL_REQUIRES (detail::has_dynamic_size <std::decay_t <SC>>,
196196 detail::not_a_layout<std::decay_t <SS>>)>
197197 inline auto adapt(T (&c_array)[N], SC&& shape, SS&& strides)
198198 {
@@ -228,13 +228,13 @@ namespace xt
228228 * @param l the layout_type of the xtensor_adaptor
229229 */
230230 template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C , class SC ,
231- XTL_REQUIRES (detail::is_array <std::decay_t <SC>>,
232- detail::not_a_pointer<C >)>
233- inline xtensor_adaptor<C, detail::array_size<SC >::value, L>
231+ XTL_REQUIRES (detail::has_fixed_size <std::decay_t <SC>>,
232+ detail::not_a_pointer<std:: remove_reference_t <C> >)>
233+ inline xtensor_adaptor<C, detail::get_fixed_size<std::decay_t<SC> >::value, L>
234234 adapt(C&& container, const SC& shape, layout_type l = L)
235235 {
236236 static_assert (!xtl::is_integral<SC>::value, " shape cannot be a integer" );
237- constexpr std::size_t N = detail::array_size<SC >::value;
237+ constexpr std::size_t N = detail::get_fixed_size<std:: decay_t <SC> >::value;
238238 using return_type = xtensor_adaptor<xtl::closure_type_t <C>, N, L>;
239239 return return_type (std::forward<C>(container), shape, l);
240240 }
@@ -246,13 +246,13 @@ namespace xt
246246 * @param l the layout_type of the xtensor_adaptor
247247 */
248248 template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C , class SC ,
249- XTL_REQUIRES (detail::is_array <std::decay_t <SC>>,
249+ XTL_REQUIRES (detail::has_fixed_size <std::decay_t <SC>>,
250250 std::is_pointer<std::remove_reference_t <C>>)>
251251 inline auto adapt(C&& pointer, const SC& shape, layout_type l = L)
252252 {
253253 static_assert (!xtl::is_integral<SC>::value, " shape cannot be a integer" );
254254 using buffer_type = xbuffer_adaptor<C, xt::no_ownership, detail::default_allocator_for_ptr_t <C>>;
255- constexpr std::size_t N = detail::array_size<SC >::value;
255+ constexpr std::size_t N = detail::get_fixed_size<std:: decay_t <SC> >::value;
256256 using return_type = xtensor_adaptor<buffer_type, N, L>;
257257 return return_type (buffer_type (pointer, compute_size (shape)), shape, l);
258258 }
@@ -265,13 +265,13 @@ namespace xt
265265 * @param strides the strides of the xtensor_adaptor
266266 */
267267 template <class C , class SC , class SS ,
268- XTL_REQUIRES (detail::is_array <std::decay_t <SC>>,
268+ XTL_REQUIRES (detail::has_fixed_size <std::decay_t <SC>>,
269269 detail::not_a_layout<std::decay_t <SS>>)>
270- inline xtensor_adaptor<C, detail::array_size<SC >::value, layout_type::dynamic>
270+ inline xtensor_adaptor<C, detail::get_fixed_size<std::decay_t<SC> >::value, layout_type::dynamic>
271271 adapt(C&& container, SC&& shape, SS&& strides)
272272 {
273273 static_assert (!xtl::is_integral<std::decay_t <SC>>::value, " shape cannot be a integer" );
274- constexpr std::size_t N = detail::array_size<SC >::value;
274+ constexpr std::size_t N = detail::get_fixed_size<std:: decay_t <SC> >::value;
275275 using return_type = xtensor_adaptor<xtl::closure_type_t <C>, N, layout_type::dynamic>;
276276 return return_type (std::forward<C>(container),
277277 xtl::forward_sequence<typename return_type::inner_shape_type, SC>(shape),
@@ -312,14 +312,14 @@ namespace xt
312312 * @param alloc the allocator used for allocating / deallocating the dynamic array
313313 */
314314 template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class P , class O , class SC , class A = detail::default_allocator_for_ptr_t <P>,
315- XTL_REQUIRES (detail::is_array <std::decay_t <SC>>)>
316- inline xtensor_adaptor<xbuffer_adaptor<xtl::closure_type_t<P>, O, A>, detail::array_size<SC >::value, L>
315+ XTL_REQUIRES (detail::has_fixed_size <std::decay_t <SC>>)>
316+ inline xtensor_adaptor<xbuffer_adaptor<xtl::closure_type_t<P>, O, A>, detail::get_fixed_size<std::decay_t<SC> >::value, L>
317317 adapt(P&& pointer, typename A::size_type size, O ownership, const SC& shape, layout_type l = L, const A& alloc = A())
318318 {
319319 static_assert (!xtl::is_integral<SC>::value, " shape cannot be a integer" );
320320 (void )ownership;
321321 using buffer_type = xbuffer_adaptor<xtl::closure_type_t <P>, O, A>;
322- constexpr std::size_t N = detail::array_size<SC >::value;
322+ constexpr std::size_t N = detail::get_fixed_size<std:: decay_t <SC> >::value;
323323 using return_type = xtensor_adaptor<buffer_type, N, L>;
324324 buffer_type buf (std::forward<P>(pointer), size, alloc);
325325 return return_type (std::move (buf), shape, l);
@@ -337,15 +337,15 @@ namespace xt
337337 * @param alloc the allocator used for allocating / deallocating the dynamic array
338338 */
339339 template <class P , class O , class SC , class SS , class A = detail::default_allocator_for_ptr_t <P>,
340- XTL_REQUIRES (detail::is_array <std::decay_t <SC>>,
340+ XTL_REQUIRES (detail::has_fixed_size <std::decay_t <SC>>,
341341 detail::not_a_layout<std::decay_t <SS>>)>
342- inline xtensor_adaptor<xbuffer_adaptor<xtl::closure_type_t<P>, O, A>, detail::array_size<SC >::value, layout_type::dynamic>
342+ inline xtensor_adaptor<xbuffer_adaptor<xtl::closure_type_t<P>, O, A>, detail::get_fixed_size<std::decay_t<SC> >::value, layout_type::dynamic>
343343 adapt(P&& pointer, typename A::size_type size, O ownership, SC&& shape, SS&& strides, const A& alloc = A())
344344 {
345345 static_assert (!xtl::is_integral<std::decay_t <SC>>::value, " shape cannot be a integer" );
346346 (void )ownership;
347347 using buffer_type = xbuffer_adaptor<xtl::closure_type_t <P>, O, A>;
348- constexpr std::size_t N = detail::array_size<SC >::value;
348+ constexpr std::size_t N = detail::get_fixed_size<std:: decay_t <SC> >::value;
349349 using return_type = xtensor_adaptor<buffer_type, N, layout_type::dynamic>;
350350 buffer_type buf (std::forward<P>(pointer), size, alloc);
351351 return return_type (std::move (buf),
@@ -361,7 +361,7 @@ namespace xt
361361 * @param l the layout_type of the xarray_adaptor
362362 */
363363 template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class T , std::size_t N, class SC ,
364- XTL_REQUIRES (detail::is_array <std::decay_t <SC>>)>
364+ XTL_REQUIRES (detail::has_fixed_size <std::decay_t <SC>>)>
365365 inline auto adapt(T (&c_array)[N], const SC& shape, layout_type l = L)
366366 {
367367 return adapt (&c_array[0 ], N, xt::no_ownership (), shape, l);
@@ -375,7 +375,7 @@ namespace xt
375375 * @param strides the strides of the xarray_adaptor
376376 */
377377 template <class T , std::size_t N, class SC , class SS ,
378- XTL_REQUIRES (detail::is_array <std::decay_t <SC>>,
378+ XTL_REQUIRES (detail::has_fixed_size <std::decay_t <SC>>,
379379 detail::not_a_layout<std::decay_t <SS>>)>
380380 inline auto adapt(T (&c_array)[N], SC&& shape, SS&& strides)
381381 {
@@ -557,7 +557,7 @@ namespace xt
557557 * @return xarray_adaptor for memory
558558 */
559559 template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class P , class SC ,
560- XTL_REQUIRES (detail::not_an_array <std::decay_t <SC>>)>
560+ XTL_REQUIRES (detail::has_dynamic_size <std::decay_t <SC>>)>
561561 auto adapt_smart_ptr(P&& smart_ptr, const SC& shape, layout_type l = L)
562562 {
563563 using buffer_adaptor = xbuffer_adaptor<decltype (smart_ptr.get ()), smart_ownership,
@@ -619,7 +619,7 @@ namespace xt
619619 * @return xarray_adaptor on the memory
620620 */
621621 template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class P , class SC , class D ,
622- XTL_REQUIRES (detail::not_an_array <std::decay_t <SC>>,
622+ XTL_REQUIRES (detail::has_dynamic_size <std::decay_t <SC>>,
623623 detail::not_a_layout<std::decay_t <D>>)>
624624 auto adapt_smart_ptr(P&& data_ptr, const SC& shape, D&& smart_ptr, layout_type l = L)
625625 {
0 commit comments