These records within the structure B
void f(int)=delete;
void f(double)=delete;
are declarations that hide the declarations with the same name f in the base structure A.
So the using declaration in B
using A::f; // needed to compile : why ?
makes all functions with the name f declared in A visible in the structure B.
Consider the following demonstrative program where in one case there is no using declaration and in the second case there is a using declarations.
#include <iostream>
int main()
{
{
struct A
{
void f( char ) const
{
std::cout << "A::f( char ) const\n";
}
};
struct B : A
{
void f( int ) const
{
std::cout << "B::f( int ) const\n";
}
};
B b;
b.f( 'A' );
}
std::cout << '\n';
{
struct A
{
void f( char ) const
{
std::cout << "A::f( char ) const\n";
}
};
struct B : A
{
using A::f;
void f( int ) const
{
std::cout << "B::f( int ) const\n";
}
};
B b;
b.f( 'A' );
}
return 0;
}
The program output is
B::f( int ) const
A::f( char ) const