template and inheritance

I'm playing around, learning my way through class, and template.
See below for a piece of my code for the class Array_1d_W which derived from Array_1d.

print() is a method defined in Array_1d.
test_method() however is a method that does not appear in Array_1d

as I'm trying things one piece at a time I notice that in order to be able to call the method print I had to use Array_1d<T1>::print().

If I don't use it, I get the following
error: use of undeclared identifier 'print'

am I doing things the right way ? Does that mean that all members need to be called using Array_1d<T1>::name_of_member ?


1
2
3
4
5
6
7
8
9
10
11
12
template <class T1>
    class Array_1d_W : public Array_1d<T1>
    {
        public:
            Array_1d_W( int nn ) : Array_1d<T1>( nn )

            void test_method( void )
            {
                Array_1d<T1>::print();

            }
    }


Thank you
When you want to use a function from the base class, I think yes.
See: 'Why am I getting errors when my template-derived-class uses a member it inherits from its template-base-class?' https://isocpp.org/wiki/faq/templates
Alright thank you all
Topic archived. No new replies allowed.