Advertisement
hnOsmium0001

Untitled

Jan 25th, 2021
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. template <class T>
  2. class VectorWriteProxy {
  3. public:
  4. _FORCE_INLINE_ T &operator[](int p_index) {
  5. CRASH_BAD_INDEX(p_index, ((Vector<T> *)(this))->_cowdata.size());
  6.  
  7. return ((Vector<T> *)(this))->_cowdata.ptrw()[p_index];
  8. }
  9. };
  10.  
  11. template <class T>
  12. class Vector {
  13. friend class VectorWriteProxy<T>;
  14.  
  15. public:
  16. VectorWriteProxy<T> write;
  17.  
  18. // ...
  19. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement