3333#if (defined(_MSC_VER) && _MSC_VER >= 1910)
3434#define NOEXCEPT (T )
3535#else
36+ #ifdef XTENSOR_ENABLE_ASSERT
37+ #define NOEXCEPT (T )
38+ #else
3639#define NOEXCEPT (T ) noexcept (T)
3740#endif
41+ #endif
3842
3943namespace xt
4044{
@@ -268,8 +272,8 @@ namespace xt
268272 ************************/
269273
270274 template <class R , class F , class ... S>
271- inline R apply (std:: size_t index, F&& func, const std::tuple<S...>& s)
272- NOEXCEPT(noexcept (func(std::get<0 >(s))))
275+ inline R
276+ apply (std:: size_t index, F&& func, const std::tuple<S...>& s) NOEXCEPT(noexcept (func(std::get<0 >(s))))
273277 {
274278 XTENSOR_ASSERT (sizeof ...(S) > index);
275279 return std::apply (
@@ -378,14 +382,16 @@ namespace xt
378382 res[i] = normalize_axis (expr.dimension (), axes[i]);
379383 }
380384
381- XTENSOR_ASSERT (std::all_of (
382- res.begin (),
383- res.end (),
384- [&expr](auto ax_el)
385- {
386- return ax_el < expr.dimension ();
387- }
388- ));
385+ XTENSOR_ASSERT (
386+ std::all_of (
387+ res.begin (),
388+ res.end (),
389+ [&expr](auto ax_el)
390+ {
391+ return ax_el < expr.dimension ();
392+ }
393+ )
394+ );
389395
390396 return res;
391397 }
@@ -397,14 +403,16 @@ namespace xt
397403 normalize_axis (E& expr, C&& axes)
398404 {
399405 static_cast <void >(expr);
400- XTENSOR_ASSERT (std::all_of (
401- axes.begin (),
402- axes.end (),
403- [&expr](auto ax_el)
404- {
405- return ax_el < expr.dimension ();
406- }
407- ));
406+ XTENSOR_ASSERT (
407+ std::all_of (
408+ axes.begin (),
409+ axes.end (),
410+ [&expr](auto ax_el)
411+ {
412+ return ax_el < expr.dimension ();
413+ }
414+ )
415+ );
408416 return std::forward<C>(axes);
409417 }
410418
@@ -425,14 +433,16 @@ namespace xt
425433 }
426434 );
427435
428- XTENSOR_ASSERT (std::all_of (
429- res.begin (),
430- res.end (),
431- [&expr](auto ax_el)
432- {
433- return ax_el < expr.dimension ();
434- }
435- ));
436+ XTENSOR_ASSERT (
437+ std::all_of (
438+ res.begin (),
439+ res.end (),
440+ [&expr](auto ax_el)
441+ {
442+ return ax_el < expr.dimension ();
443+ }
444+ )
445+ );
436446
437447 return res;
438448 }
@@ -447,14 +457,16 @@ namespace xt
447457 R res;
448458 xt::resize_container (res, std::size (axes));
449459 std::copy (std::begin (axes), std::end (axes), std::begin (res));
450- XTENSOR_ASSERT (std::all_of (
451- res.begin (),
452- res.end (),
453- [&expr](auto ax_el)
454- {
455- return ax_el < expr.dimension ();
456- }
457- ));
460+ XTENSOR_ASSERT (
461+ std::all_of (
462+ res.begin (),
463+ res.end (),
464+ [&expr](auto ax_el)
465+ {
466+ return ax_el < expr.dimension ();
467+ }
468+ )
469+ );
458470 return res;
459471 }
460472
@@ -464,14 +476,16 @@ namespace xt
464476 R&&>
465477 {
466478 static_cast <void >(expr);
467- XTENSOR_ASSERT (std::all_of (
468- std::begin (axes),
469- std::end (axes),
470- [&expr](auto ax_el)
471- {
472- return ax_el < expr.dimension ();
473- }
474- ));
479+ XTENSOR_ASSERT (
480+ std::all_of (
481+ std::begin (axes),
482+ std::end (axes),
483+ [&expr](auto ax_el)
484+ {
485+ return ax_el < expr.dimension ();
486+ }
487+ )
488+ );
475489 return std::move (axes);
476490 }
477491
@@ -905,18 +919,18 @@ namespace xt
905919 {
906920 explicit overlapping_memory_checker (const Dst& aDst)
907921 : overlapping_memory_checker_base(
908- [&]()
909- {
910- if (aDst.size () == 0 )
911- {
912- return memory_range ();
913- }
914- else
915- {
916- return memory_range (std::addressof (*aDst.begin ()), std::addressof (*aDst.rbegin ()));
917- }
918- }()
919- )
922+ [&]()
923+ {
924+ if (aDst.size () == 0 )
925+ {
926+ return memory_range ();
927+ }
928+ else
929+ {
930+ return memory_range (std::addressof (*aDst.begin ()), std::addressof (*aDst.rbegin ()));
931+ }
932+ }()
933+ )
920934 {
921935 }
922936 };
0 commit comments