diff --git a/include/xsimd/types/xsimd_complex_base.hpp b/include/xsimd/types/xsimd_complex_base.hpp index 44366381b..d0b52eca0 100644 --- a/include/xsimd/types/xsimd_complex_base.hpp +++ b/include/xsimd/types/xsimd_complex_base.hpp @@ -144,7 +144,9 @@ namespace xsimd explicit simd_complex_batch(const value_type& v); explicit simd_complex_batch(const real_value_type& v); explicit simd_complex_batch(const real_batch& re); + explicit simd_complex_batch(const real_value_type* v) : simd_complex_batch(real_batch(v)) {} simd_complex_batch(const real_batch& re, const real_batch& im); + simd_complex_batch(const real_value_type* re, const real_value_type* im) : simd_complex_batch(real_batch(re), real_batch(im)) {} real_batch& real(); real_batch& imag(); diff --git a/test/test_batch_complex.cpp b/test/test_batch_complex.cpp index b93adc8b1..fe15b2928 100644 --- a/test/test_batch_complex.cpp +++ b/test/test_batch_complex.cpp @@ -113,11 +113,17 @@ class batch_complex_test : public testing::Test tmp[i] = value_type(real[i]); } - batch_type b2(real_batch_type(real.data())); + batch_type b2(real.data()); EXPECT_EQ(b2, tmp) << print_function_name("batch(real_batch)"); - batch_type b3(real_batch_type(real.data()), real_batch_type(imag.data())); + batch_type b3(real.data(), imag.data()); EXPECT_EQ(b3, lhs) << print_function_name("batch(real_batch, real_batch)"); + + batch_type b4(real_batch_type(real.data())); + EXPECT_EQ(b4, tmp) << print_function_name("batch(real_ptr)"); + + batch_type b5(real_batch_type(real.data()), real_batch_type(imag.data())); + EXPECT_EQ(b5, lhs) << print_function_name("batch(real_ptr, real_ptr)"); } void test_access_operator() const