Skip to content

Commit

Permalink
[dist] use xstd::void_t again in is_matrix_type_builder
Browse files Browse the repository at this point in the history
This works around a (likely) GCC 7.5 bug when using std::void_t.
  • Loading branch information
MarcelKoch committed Oct 15, 2024
1 parent 2bbcfb9 commit fce6ef3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
18 changes: 17 additions & 1 deletion include/ginkgo/core/base/std_extensions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,24 @@ namespace gko {
* @ingroup xstd
*/
namespace xstd {
namespace detail {


template <typename... Ts>
struct make_void {
using type = void;
};


} // namespace detail


/**
* Use the custom implementation, since the std::void_t used in
* is_matrix_type_builder seems to trigger a compiler bug in GCC 7.5.
*/
template <typename... Ts>
using void_t = std::void_t<Ts...>;
using void_t = typename detail::make_void<Ts...>::type;


GKO_DEPRECATED("use std::uncaught_exceptions")
Expand Down
3 changes: 2 additions & 1 deletion include/ginkgo/core/distributed/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#include <ginkgo/core/base/dense_cache.hpp>
#include <ginkgo/core/base/mpi.hpp>
#include <ginkgo/core/base/std_extensions.hpp>
#include <ginkgo/core/distributed/base.hpp>
#include <ginkgo/core/distributed/index_map.hpp>
#include <ginkgo/core/distributed/lin_op.hpp>
Expand Down Expand Up @@ -55,7 +56,7 @@ struct is_matrix_type_builder : std::false_type {};
template <typename Builder, typename ValueType, typename IndexType>
struct is_matrix_type_builder<
Builder, ValueType, IndexType,
std::void_t<
xstd::void_t<
decltype(std::declval<Builder>().template create<ValueType, IndexType>(
std::declval<std::shared_ptr<const Executor>>()))>>
: std::true_type {};
Expand Down

0 comments on commit fce6ef3

Please sign in to comment.