Skip to content

Commit e808799

Browse files
Proper static_assert when trying to instantiate a batch while no arch is supported
Fix #1143
1 parent 92ec982 commit e808799

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

include/xsimd/xsimd.hpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,16 @@
6363
#include "memory/xsimd_aligned_allocator.hpp"
6464

6565
#if defined(XSIMD_NO_SUPPORTED_ARCHITECTURE)
66-
// to type definition or anything appart from scalar definition and aligned allocator
66+
// no type definition or anything apart from scalar definition and aligned allocator
67+
namespace xsimd
68+
{
69+
template <class T, class A = void>
70+
class batch
71+
{
72+
static constexpr bool supported_architecture = sizeof(A*) == 0; // type-dependant but always false
73+
static_assert(supported_architecture, "No SIMD architecture detected, cannot instantiate a batch");
74+
};
75+
}
6776
#else
6877
#include "types/xsimd_batch.hpp"
6978
#include "types/xsimd_batch_constant.hpp"

0 commit comments

Comments
 (0)