constexpr reshape helper

This commit is contained in:
Erik Schultheis
2022-04-05 17:32:17 +00:00
committed by Antonio Sánchez
parent 403fa33409
commit df87d40e34
2 changed files with 7 additions and 8 deletions

View File

@@ -41,10 +41,9 @@ inline Index get_runtime_reshape_size(AutoSize_t /*size*/, Index other, Index to
return total/other;
}
template<int Flags, int Order>
struct get_compiletime_reshape_order {
enum { value = Order == AutoOrder ? Flags & RowMajorBit : Order };
};
constexpr inline int get_compiletime_reshape_order(int flags, int order) {
return order == AutoOrder ? flags & RowMajorBit : order;
}
}