Advertisement
bogolyubskiyalexey

Untitled

Mar 5th, 2021
736
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <cassert>
  4.  
  5. template <class T>
  6. class TMatrix {
  7. private:
  8.    
  9. public:
  10.    
  11.     template<class G = TMatrix<T>>
  12.     class Iterator {
  13.     public:
  14.         Iterator(G& matrix, size_t row = 0, size_t column = 0)
  15.             : matrix_(matrix)
  16.             , row_(row)
  17.             , column_(column)
  18.         {
  19.         }
  20.  
  21.         void f() {
  22.  
  23.         }
  24.         int field;
  25.     private:
  26.         G& matrix_;
  27.         size_t row_;
  28.         size_t column_;
  29.     };
  30.  
  31.     using ConstIterator = Iterator<const TMatrix<T>>;
  32.  
  33.  
  34.  
  35. private:
  36.     std::vector<std::vector<T>> data_;
  37. };
  38.  
  39.  
  40.  
  41. int main() {
  42.     {
  43.         TMatrix<int> t;
  44.         TMatrix<int>::Iterator it(t);
  45.         TMatrix<int>::ConstIterator it2(t);
  46.  
  47.     }
  48.  
  49.     //static_assert(sizeof(int) == sizeof(int16_t));
  50.     const int N = 8;
  51.     static_assert(sizeof(int) == N / 2);
  52.     //static_assert(100 == 200);
  53.     assert(100 == 200);
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement