Skip to content
Snippets Groups Projects
Commit 5970a3cc authored by Christoph Grüninger's avatar Christoph Grüninger Committed by Timo Koch
Browse files

Use detector idiom correctly

Do not access the nested typedefs value_t and type. They
are mere implementation details.
GCC 13 / libstdc++ does no longer provide value_t which
leads to compilation errors.
parent f47fb40a
No related branches found
No related tags found
1 merge request!3369Use standard-conforming detector idiom
Pipeline #26404 passed
+2
......@@ -34,9 +34,6 @@ namespace Detail {
template<class Assembler, class Index>
using DetectPVSwitchMultiDomain = typename Assembler::template GridVariables<Index::value>::VolumeVariables::PrimaryVariableSwitch;
template<class Assembler, std::size_t i>
using GetPVSwitchMultiDomain = Dune::Std::detected_or<int, DetectPVSwitchMultiDomain, Assembler, Dune::index_constant<i>>;
} // end namespace Detail
/*!
......@@ -56,10 +53,12 @@ class MultiDomainNewtonSolver: public NewtonSolver<Assembler, LinearSolver, Reas
static constexpr bool assemblerExportsVariables = Detail::exportsVariables<Assembler>;
template<std::size_t i>
using PrimaryVariableSwitch = typename Detail::GetPVSwitchMultiDomain<Assembler, i>::type;
using PrimaryVariableSwitch =
Dune::Std::detected_or_t<int, Detail::DetectPVSwitchMultiDomain, Assembler, Dune::index_constant<i>>;
template<std::size_t i>
using HasPriVarsSwitch = typename Detail::GetPVSwitchMultiDomain<Assembler, i>::value_t; // std::true_type or std::false_type
using HasPriVarsSwitch =
Dune::Std::is_detected<Detail::DetectPVSwitchMultiDomain, Assembler, Dune::index_constant<i>>; // std::true_type or std::false_type
template<std::size_t i>
using PrivarSwitchPtr = std::unique_ptr<PrimaryVariableSwitch<i>>;
......
......@@ -36,10 +36,7 @@ template<class Variables>
using DetectPVSwitch = typename Variables::VolumeVariables::PrimaryVariableSwitch;
template<class Variables>
using GetPVSwitch = Dune::Std::detected_or<int, DetectPVSwitch, Variables>;
template<class Variables>
using PrimaryVariableSwitch = typename GetPVSwitch<Variables>::type;
using PrimaryVariableSwitch = Dune::Std::detected_or_t<int, DetectPVSwitch, Variables>;
} // end namespace Detail
......@@ -48,7 +45,7 @@ using PrimaryVariableSwitch = typename GetPVSwitch<Variables>::type;
* \brief Helper boolean to check if the given variables involve primary variable switching.
*/
template<class Variables>
inline constexpr bool hasPriVarsSwitch = typename Detail::GetPVSwitch<Variables>::value_t();
inline constexpr bool hasPriVarsSwitch = Dune::Std::is_detected<Detail::DetectPVSwitch, Variables>();
/*!
* \ingroup Nonlinear
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment