Skip to content

Commit

Permalink
[test] Replace std::enable_if with requires
Browse files Browse the repository at this point in the history
  • Loading branch information
krivenko committed Aug 24, 2024
1 parent 831f823 commit 9a3cee3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/c++/test_kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ namespace som {

// h5_read_mathematica_array(), complex arrays
template <typename ArrayType>
std::enable_if_t<is_complex<typename ArrayType::value_type>::value, ArrayType>
h5_read_mathematica_array(h5::group g, std::string const& name) {
ArrayType h5_read_mathematica_array(h5::group g, std::string const& name)
requires(is_complex<typename ArrayType::value_type>::value)
{
array<typename ArrayType::value_type, ArrayType::rank> res_re, res_im;
h5_read(g, name + "/re", res_re);
h5_read(g, name + "/im", res_im);
Expand All @@ -55,8 +56,9 @@ h5_read_mathematica_array(h5::group g, std::string const& name) {

// h5_read_mathematica_array(), real arrays
template <typename ArrayType>
std::enable_if_t<!is_complex<typename ArrayType::value_type>::value, ArrayType>
h5_read_mathematica_array(h5::group g, std::string const& name) {
ArrayType h5_read_mathematica_array(h5::group g, std::string const& name)
requires(!is_complex<typename ArrayType::value_type>::value)
{
ArrayType res;
h5_read(g, name, res);
return res;
Expand Down

0 comments on commit 9a3cee3

Please sign in to comment.