assert(secondInterval.GetUpperBoundary()>=firstInterval.GetLowerBoundary()&&firstInterval.GetUpperBoundary()>=secondInterval.GetLowerBoundary());// Non-intersecting intervals should never reach here
// Caspar, will gcc allow "return std::array<IntervalType, 2>{};"? I'm not sure that the compiler will perform NRVO here.
// I know it's kinda ridiculous to optimize for such things here, with 2-3 calls of this functions per plane, but I mean why not :)
// Plus, it will look more similar with the rest of the return statements
// Or perhaps, even better, "return { IntervalType{}, IntervalType{} }" to be even more explicit and similar.
std::array<IntervalType,2>empty;
returnempty;// firstInterval completely enclosed
}
return{IntervalType{firstInterval.GetUpperBoundary(),secondInterval.GetUpperBoundary()},IntervalType{}};// secondInterval removes the beginning of firstInterval
return{IntervalType{firstInterval.GetLowerBoundary(),secondInterval.GetLowerBoundary()},IntervalType{}};// secondInterval removes the end of firstInterval
IntervalType{secondInterval.GetUpperBoundary(),firstInterval.GetUpperBoundary()}};// secondInterval is completely enclosed in firstInterval and removes the middle