Skip to content

[cling] Prompt autocomplete should treat smart pointers as pointers, not as generic classes #22019

@silverweed

Description

@silverweed

Explain what you would like to see improved and how.

In the ROOT interactive prompt, if you have a smart pointer foo, type foo-> and hit Tab, the autocomplete function will change the -> into a . and say:

"foo" is not of pointer type. Use this operator: .

This is almost always an undesirable behavior when dealing with smart pointers, as it's far more common to want to autocomplete with the inner object's methods/fields rather than the smart pointer's own ones.

Proposed change: change the prompt behavior to treat specially unique_ptr, shared_ptr and weak_ptr (or perhaps in general all classes that define operator->?) so that it autocompletes the referenced object's methods and fields.

ROOT version

master

Installation method

any

Operating system

any

Additional context

No response

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions