File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -382,6 +382,21 @@ namespace detail
382382
383383 template <typename BaseRecord>
384384 void verifyNonscalar (BaseRecord *self);
385+
386+ template <typename T>
387+ struct IsBaseRecord
388+ {
389+ constexpr static bool value = false ;
390+ };
391+
392+ template <typename T>
393+ struct IsBaseRecord <BaseRecord<T>>
394+ {
395+ constexpr static bool value = true ;
396+ };
397+
398+ template <typename T>
399+ constexpr bool IsBaseRecord_v = IsBaseRecord<T>::value;
385400} // namespace detail
386401
387402template <typename T_elem>
Original file line number Diff line number Diff line change @@ -784,14 +784,22 @@ void ScientificDefaults<Child>::defaults_impl(OpenpmdStandard standard)
784784 // .withReader(float_types, require_type<double>())
785785 (wor);
786786 }
787- else if constexpr (auxiliary::IsTemplateBaseOf_v<BaseRecord, Child>)
787+ else if constexpr (detail::IsBaseRecord_v< Child>)
788788 {
789789 defaultAttribute (" unitDimension" )
790790 .withGenericSetter (unit_representations::AsArray{})
791791 .withReader (
792792 float_types,
793793 require_type<unit_representations::AsArray>())(wor);
794794 }
795+ else if constexpr (std::is_same_v<Child, ParticleSpecies>)
796+ {
797+ // no-op
798+ }
799+ else
800+ {
801+ static_assert (auxiliary::dependent_false_v<Child>, " Unknown class" );
802+ }
795803}
796804
797805template <typename Child>
You can’t perform that action at this time.
0 commit comments