Template

Mar 4, 2014 at 12:33pm
i don't understand this piece of code..

 
template <class T> class Base : A<T>
Mar 4, 2014 at 12:57pm
Base is basically a templated class that derives from A w/c also is a templated class, the template argument for Base will be the same for A

1
2
3
4
5
6
7
template<class T>
  class A
{ };

template<class T>
  class B : private A<T>
{ };
Last edited on Mar 4, 2014 at 1:00pm
Mar 4, 2014 at 1:50pm
nvrmnd wrote:
Base is basically a templated class that derives from A w/c also is a templated class
What does "w/c" mean?
Mar 4, 2014 at 2:08pm
bathroom (water closet)

please DEA
Mar 4, 2014 at 2:12pm
which (is there something wrong w/ my answer ??)
Last edited on Mar 4, 2014 at 2:14pm
Mar 4, 2014 at 4:03pm
I've never seen "which" shortened as "w/c", as ne555 says all sources say "w/c" is shorthand for "watercloset" aka 'toilet'. Obviously I was confused as to the meaning of your post, but since you clarified that you meant "which" the confusion is gone.
Mar 4, 2014 at 5:00pm
In essence, it has to do with inheritance or not?
Edit: I undestrood..thanks for all guys! =)
Last edited on Mar 4, 2014 at 5:14pm
Mar 4, 2014 at 5:08pm
Templates and inheritance are unrelated. It just so happens that the example you gave uses both.
Topic archived. No new replies allowed.