返回题库

Quant Interview Practice Questions

专题
architecture & logic
难度
L1
来源
MyntBit

题目详情

In low-latency trading systems, type safety is critical to prevent the accidental mixing of order sides, prices, and quantities. Utilizing a strongly typed scoped enumeration for order sides enforces this safety, while a constexpr function allows the compiler to evaluate the opposite side at compile time to eliminate runtime overhead. Task Implement a scoped enumeration enum class OrderSide containing two values: Buy = 0 and Sell = 1. Then, write a constexpr function flipSide(OrderSide side) th