Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spell out using declaration #178

Closed
pseyfert opened this issue Apr 11, 2019 · 1 comment · Fixed by #185
Closed

spell out using declaration #178

pseyfert opened this issue Apr 11, 2019 · 1 comment · Fixed by #185
Labels
enhancement New feature or request

Comments

@pseyfert
Copy link

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;
};
@andreasfertig
Copy link
Owner

Hello @pseyfert,

great idea, I like it. I will look how and when I add it.

Andreas

@andreasfertig andreasfertig added the enhancement New feature or request label Apr 14, 2019
andreasfertig added a commit that referenced this issue May 13, 2019
For example:
```
struct X {
  int f(int);
  int f(double);
protected:
  int x;
};

struct Y: X {
  using X::f;
  using X::x;
};
```

Will make the functions `f(int)` and `f(double)` available in `Y` as
well as it moves `X::x` from `protected` to `public` in `Y`. All these
functions or members are shown as comments only.
andreasfertig added a commit that referenced this issue May 13, 2019
For example:
```
struct X {
  int f(int);
  int f(double);
protected:
  int x;
};

struct Y: X {
  using X::f;
  using X::x;
};
```

Will make the functions `f(int)` and `f(double)` available in `Y` as
well as it moves `X::x` from `protected` to `public` in `Y`. All these
functions or members are shown as comments only.
andreasfertig added a commit that referenced this issue May 13, 2019
For example:
```
struct X {
  int f(int);
  int f(double);
protected:
  int x;
};

struct Y: X {
  using X::f;
  using X::x;
};
```

Will make the functions `f(int)` and `f(double)` available in `Y` as
well as it moves `X::x` from `protected` to `public` in `Y`. All these
functions or members are shown as comments only.
andreasfertig added a commit that referenced this issue May 13, 2019
…a using.

For example:
```
struct X {
  int f(int);
  int f(double);
protected:
  int x;
};

struct Y: X {
  using X::f;
  using X::x;
};
```

Will make the functions `f(int)` and `f(double)` available in `Y` as
well as it moves `X::x` from `protected` to `public` in `Y`. All these
functions or members are shown as comments only.

Fixed #184 which points out the invalid prefix from a using decl.
andreasfertig added a commit that referenced this issue May 13, 2019
…a using.

For example:
```
struct X {
  int f(int);
  int f(double);
protected:
  int x;
};

struct Y: X {
  using X::f;
  using X::x;
};
```

Will make the functions `f(int)` and `f(double)` available in `Y` as
well as it moves `X::x` from `protected` to `public` in `Y`. All these
functions or members are shown as comments only.

Fixed #184 which points out the invalid prefix from a using decl.
andreasfertig added a commit that referenced this issue May 13, 2019
Fixed #178, 184: Provide the functions pulled in from a base class via using
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants