Pair class template

Hello everyone, I have a doubt, I have got a code and I'm trying to understand it...I have got some doubt at this point..

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

class ParBCD : protected N2DigsBCD {
		friend istream & operator >> (istream &,ParBCD);
		friend ostream & operator << (ostream &,ParBCD);
	public:
		ParBCD(); // constructor por defecto
		ParBCD(DigBCD,DigBCD);
		ParBCD(const N2DigsBCD &);
		explicit ParBCD(N2DigsBCD &);
		ParBCD(uchint,uchint);
                ...........

typedef pair<DigBCD,DigBCD> N2DigsBCD;


enum DigBCD {c=uci(0),u=uci(1),d=uci(2),t=uci(3),q=uci(4),z=uci(5),x=uci(6),s=uci(7),o=uci(8),n=uci(9),E=uci(255)};



As far as I know pair is a template class that combinates two types, but It seems that it doesnt have to have function member on his own(it could have I think) because everything is managed by the member of the types(in this case the member are two enum so they dont have member function).The pair that I'm using is the one on the top.

What the template cointains are two enum( the enum that I show on the above code).

My question is the next:in the class ParBCD N2DigsBCD are declared as a protected, so all the members of N2DigsBCD will be protected from outside of inheritance class(ParBCD)??.

When I declare a pair template I dont need to define anything, just with the declaration is enough????, because It is suppossed to have the right member to manage frist and second, I mean the ones have been declared in their own types(first and second are the key words to run the template types).

Thank you all
Topic archived. No new replies allowed.