1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#include <iostream>
#include <string>
#include <valarray>
using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::valarray;
template <class T1, class T2>
class Pair {
private:
T1 a;
T2 b;
public:
T1 & first();
T2 & second();
T1 first() const {return a;}
T2 second() const {return b;}
Pair(const T1 & aval, const T2 & bval) : a(aval), b(bval) {}
Pair() {}
};
class Wine {
private:
string name;
Pair<valarray<int>, valarray<int> > ys;
int arrsize;
public:
// Wine(int as = 20, valarray<int> a = valarray<int> (0,20), valarray<int> b = valarray<int> (0,20));
Wine(int as = 20);
Wine(const char * l, int y, const int yr[], const int bot[]);
Wine(const char * l, int y);
void getbottles();
string label();
int sum();
};
// Wine::Wine(int as, valarray<int> a, valarray<int> b) : ys(a, b) {
// name = "";
// arrsize = 0;
// }
Wine::Wine(int as) {
name = "";
arrsize = 0;
ys(valarray<int> (0,20), valarray<int> (0,20)); //On this line g++ finds the problem
}
int main(void) {
return 0;
}
|