@@ -75,8 +75,8 @@ struct BuyTradeRequest {
7575 Money money;
7676 BuyTradeRequest** refer = nullptr ;
7777
78- BuyTradeRequest (StockCount amount_, Trader& trader_, Money&& money )
79- : amount(amount_), trader(trader_), money(std::move(money )) {}
78+ BuyTradeRequest (StockCount amount_, Trader& trader_, Money&& money_ )
79+ : amount(amount_), trader(trader_), money(std::move(money_ )) {}
8080
8181 void reject () {
8282 money.move (money.as_Price ()).to (trader.money );
@@ -150,31 +150,31 @@ struct TradeBoard {
150150 }
151151 }
152152
153- const auto & getBuyBoard () const {
153+ constexpr const auto & getBuyBoard () const {
154154 return buy;
155155 }
156156
157- const auto & getSellBoard () const {
157+ constexpr const auto & getSellBoard () const {
158158 return sell;
159159 }
160160
161- const auto & StockValue () const {
161+ constexpr const auto & StockValue () const {
162162 return stock_value;
163163 }
164164
165165 void updateStockValue (StockPrice price, StockMarketRef market);
166166
167167 void tick () noexcept ;
168168
169- const auto & getHistory () const noexcept {
169+ constexpr const auto & getHistory () const noexcept {
170170 return history;
171171 }
172172
173- const auto & getPriceLimit () const noexcept {
173+ constexpr const auto & getPriceLimit () const noexcept {
174174 return limit;
175175 }
176176
177- const auto & getCurrentPrice () const noexcept {
177+ constexpr const auto & getCurrentPrice () const noexcept {
178178 return history.getCurrentPrice ();
179179 }
180180
@@ -199,7 +199,7 @@ struct TradeBoard {
199199 util::RingQueue<std::deque<Request_t>, 24 , limit_destructor_t > limit_queue;
200200
201201 template <class ... Args>
202- void add (int expire, StockPrice price, Args&&... arg) {
202+ void add (size_t expire, StockPrice price, Args&&... arg) {
203203 limit_queue.get (expire).emplace_back (std::forward<Args>(arg)...);
204204 auto * elem = &limit_queue.get (expire).back ();
205205
@@ -228,7 +228,7 @@ struct TradeBoard {
228228 };
229229
230230 struct sell_limit_destruct {
231- static void run (std::deque<SellTradeRequest>&, StockId );
231+ static void run (std::deque<SellTradeRequest>&);
232232 };
233233
234234 TradeRequestBoard<BuyTradeRequest, buy_limit_destruct> buy;
0 commit comments