How to implement conditional branch in constant generics

See:

In it you can see you need to forward the bounds on the const bool, such as:

  impl<Left: IDataType, Right: IDataType> IDataType for MaxSizeType<Left, Right>
+ where
+     Condition<Left, Right, { Left::TYPE_SIZE > Right::TYPE_SIZE }> : IDataType,
  {
      const TYPE_SIZE: usize = 0;

      type DataType = <Condition<Left, Right, { Left::TYPE_SIZE > Right::TYPE_SIZE }> as IDataType>::DataType;
  }
2 Likes