Skip to content

add function which returns pointer to added element #42

@duarm

Description

@duarm

Feature Request Template

What is the nature of this request?

  • New functionalities

Is your feature request related to a problem? Please describe.

Currently, if you want to add an element then get it's reference, you need to first call _push_back, then _get_ref(_count(list) - 1), _back returns a copy, so we can't use that. This is quite verbose.

Describe the solution you'd like

it would be useful if we had an _push_back_ref, function, which is like _push_back, but it returns the pointer instead of a bool.

Maybe a _back_ref

Not sure if expanding the API surface is worth it, but it might be worth considering.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions