Guest User

Untitled

a guest
Jul 3rd, 2024
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. class foo
  2. {
  3. public:
  4.     foo() noexcept : m_index(0)
  5.     {
  6.     }
  7.  
  8.     void operator ++ () noexcept
  9.     {
  10.         m_index = m_indicies[m_index];
  11.     }
  12.  
  13.     char value() const noexcept
  14.     {
  15.         return m_value_jump[m_index];
  16.     }
  17.  
  18. private:
  19.     char m_index;
  20.     static constexpr std::array<const char, 8> m_value_jump = { 3,8,4,3,7,0,1,1 }; //random values
  21.     static constexpr std::array<const char, 8> m_indicies = { 1, 2, 3, 4, 5, 6, 7, 0 };
  22. };
Advertisement
Add Comment
Please, Sign In to add comment