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

Using span and string_view instead of raw pointers #4159

Open
9 tasks
lgritz opened this issue Feb 19, 2024 · 0 comments
Open
9 tasks

Using span and string_view instead of raw pointers #4159

lgritz opened this issue Feb 19, 2024 · 0 comments
Labels
core APIs Affecting public APIs of core functionality classes, such as ImageInput, ImageOutput, ImageBuf. roadmap This is a priority item on the roadmap for the next major release.

Comments

@lgritz
Copy link
Collaborator

lgritz commented Feb 19, 2024

This task is to scrub the major APIs and eliminate as many places (as is practical, we know some may be harder than others) where we have API calls that take a pointer and size (or worse -- just a pointer and an assumption about the size), and instead use span<T>/cspan<T> for things that are like arrays, and string_view for things that are like strings.

For calls falling into this category, we'll have to decide on a case-by-case basis whether to (a) add a new variety of the call that takes a span, deprecating the old one, (b) replace the old one entirely.

Just as a way to seed you with ideas, and since this work can be parallelized by different people taking different classes, here is a list of some headers that probably contain functions that could use this cleanup:

  • argparse.h
  • deepdata.h
  • imagebuf.h
  • imagebufalgo.h
  • imagecache.h
  • imageio.h
  • paramlist.h
  • strutil.h
  • texture.h
@lgritz lgritz added core APIs Affecting public APIs of core functionality classes, such as ImageInput, ImageOutput, ImageBuf. roadmap This is a priority item on the roadmap for the next major release. labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core APIs Affecting public APIs of core functionality classes, such as ImageInput, ImageOutput, ImageBuf. roadmap This is a priority item on the roadmap for the next major release.
Projects
None yet
Development

No branches or pull requests

1 participant