Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. [apuhach@latitude SegmentTree]$ git diff basic.h
  2. diff --git a/DataStructures/SegmentTree/basic.h b/DataStructures/SegmentTree/basic.h
  3. index 72d3f9e..cfd74c8 100644
  4. --- a/DataStructures/SegmentTree/basic.h
  5. +++ b/DataStructures/SegmentTree/basic.h
  6. @@ -1,12 +1,14 @@
  7. /*
  8. struct SegTreeOps {
  9. - T combine(T a, T b);
  10. - T update(T cur, UPD val);
  11. + static T combine(T a, T b);
  12. + static T update(T cur, UPD val);
  13. };
  14. */
  15. -template<typename OPS, typename T, typename UPD>
  16. +template<typename OPS, typename UPD>
  17. class SegTree {
  18. public:
  19. + using T = typename result_of<OPS::combine>::type;
  20. +
  21. SegTree(int n): data(4*n), n(n) {
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement