Skip to content

spell out using declaration #178

@pseyfert

Description

@pseyfert

I was wondering about this example (source quoted below).

Y has an overload set for f that container int f(), int f(int), int f(double), int f(float) but from the class declaration to the human reader
only f(float is visible and using X::f suggests there are more.

Does it make sense to spell out the using declared overload set in
cppinsights.io?

I think it would be nice to see what one imports with the using declaration.

I see in cppinsights one can somewhat infer what's going on on the call site

int one = static_cast<X&>(y).f(...)

vs

int two = y.f(...)

This reveals from which class f is used. But the full overload set for f is
not visible.

Opinions/comments?

class sources

struct X{
  int f();
  int f(int);
  int f(double);
};

struct Y:X {
  int f(float);
  using X::f;
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions