All pastes #561564 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-12 14:44 UTC
rendered paste body
template <class T, int a, int b>
class grille {
  public:
    grille();
    T &operator[](const unsigned int);
    template <class H, int x, int y>
    friend  std::ostream &operator<<(std::ostream &, const grille<T, x, y> &g);
  private:
    T tab[a][b];
};

/// Bruno propose:
/*
template <class T, int a, int b>
class grille
{
public:
  grille() {}

  T* operator[](const unsigned int x)
  {
    return tab[x];
  }

private:
  T tab[a][b];
};

template <class H, int x, int y>
std::ostream &operator<<(std::ostream &out, const grille<H, x, y> &g)
{
  std::cout << "Test" << std::endl;
  return out;
}
*/