tera specified
| 50 | |
| 51 | // tera specified |
| 52 | value_type Sum() { |
| 53 | static_assert(std::is_arithmetic<value_type>::value, |
| 54 | "Only arithmetic value is able to use Sum method"); |
| 55 | if (Empty()) { |
| 56 | return 0; |
| 57 | } |
| 58 | return std::accumulate(std::begin(qu_), std::end(qu_), (value_type)0, |
| 59 | [](value_type x, const value_type& y) { return x + y; }); |
| 60 | } |
| 61 | |
| 62 | value_type Average() { |
| 63 | static_assert(std::is_arithmetic<value_type>::value, |