SegmentStore: Use a static_cast to avoid writing the same code for each type of Segment