Skip to content

Instantly share code, notes, and snippets.

@boldijar
Created June 16, 2016 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boldijar/86fba58f439eef83fbac30902cfbdbae to your computer and use it in GitHub Desktop.
Save boldijar/86fba58f439eef83fbac30902cfbdbae to your computer and use it in GitHub Desktop.
// invat_pt_scris.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <string>
#include <vector>
#include <assert.h>
template <class T>
class grades
{
public:
T g[100];
int size = 0;
grades() :size(0) {}
grades operator+(T grade) {
grades newG(*this);
newG.g[newG.size] = grade;
newG.size++;
return newG;
}
int getSize() {
return this->size;
}
};
using namespace std;
int main() {
grades<int> g;
g = g + 1;
g = g + 2;
cout << g.getSize();
int b;
cin >> b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment