Using span and string_view instead of raw pointers

Aperta
#4,159 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp

Direzione di ricerca

Inizia facendo un inventario delle API che usano puntatore e dimensione negli header elencati: argparse.h, deepdata.h, imagebuf.h, imagebufalgo.h, imagecache.h, imageio.h, paramlist.h, strutil.h e texture.h. Esamina il ruolo API di ogni chiamata e decidi se debba aggiungere un overload span/string_view oppure sostituire la forma esistente; il lavoro è completo quando i candidati pratici sono stati aggiornati con decisioni di compatibilità coerenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

core APIs roadmap

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
Lingua principale
C++
Stelle
2.4k
Fork
727
Merge medio
4g 8h
PR unite (30g)
67

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AcademySoftwareFoundation/OpenImageIO

Tutte le issue di AcademySoftwareFoundation/OpenImageIO

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.