![]() |
compiler warning
Hi the following code gives me the warning "warning: passing
'double' for argument 1 to 'void B::test(int)" class A { public: void test(int a) {} void test(double d) {} }; class B : public A { public: void test(int a) { double d = 0.0; test(d); ---> this line cause the warning. } }; But the function "test(double d)" is inherited by B from A. Why can this function not be resolved. Thanks. |
Re: compiler warning
On Mar 12, 12:11*pm, djsho...@gmail.com wrote:
[snip] > But the function "test(double d)" is inherited by B from A. Why can > this function not be resolved. Have you read the FAQ? http://www.parashift.com/c++-faq-lit...heritance.html Socks |
Re: compiler warning
djshoham@gmail.com wrote:
> Hi the following code gives me the warning "warning: passing > 'double' for argument 1 to 'void B::test(int)" > > class A > { > public: > > void test(int a) {} > > void test(double d) {} > }; > > class B : public A > { > public: using A::test; > > void test(int a) > { > double d = 0.0; > test(d); ---> this line cause the warning. > } > }; > > But the function "test(double d)" is inherited by B from A. Why can > this function not be resolved. > > Thanks. > |
Re: compiler warning
On Mar 12, 6:21 pm, Puppet_Sock <puppet_s...@hotmail.com> wrote:
> On Mar 12, 12:11 pm, djsho...@gmail.com wrote: > [snip] > > > But the function "test(double d)" is inherited by B from A. Why can > > this function not be resolved. > > Have you read the FAQ? > > http://www.parashift.com/c++-faq-lit...heritance.html > Socks The FAQ was extremely helpful. Thanks very much! |
| All times are GMT. The time now is 10:39 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.