Skip to content
Snippets Groups Projects
  • Carsten Gräser's avatar
    cc038f05
    [bugfix] Use const references in Hybrid::Imp::equals() · cc038f05
    Carsten Gräser authored
    If T2/T2 are not defined by 'const T1&', they will themselfes
    be of reference type. Hence T2::value does not exist and the
    equals() overload for the static evaluation is not selected.
    Then the dynamic equals() overload is used. This will give the
    same result, but the compiler will instantiate the if branch
    with the identity if if the result is 'false'.
    
    This is what lead to a failing test in dune-tnnmg when looping
    over a MultitypeMatrix because the if-branch is used with the
    wrong type.
    cc038f05
    History
    [bugfix] Use const references in Hybrid::Imp::equals()
    Carsten Gräser authored
    If T2/T2 are not defined by 'const T1&', they will themselfes
    be of reference type. Hence T2::value does not exist and the
    equals() overload for the static evaluation is not selected.
    Then the dynamic equals() overload is used. This will give the
    same result, but the compiler will instantiate the if branch
    with the identity if if the result is 'false'.
    
    This is what lead to a failing test in dune-tnnmg when looping
    over a MultitypeMatrix because the if-branch is used with the
    wrong type.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.