summaryrefslogtreecommitdiff
path: root/indra/llcommon/llerror.h
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-09-27 11:07:08 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-09-27 11:07:08 -0400
commit1c78829ab3177940adbdb7f0081b5f46c1e37763 (patch)
tree944153e4a22b8ef9a4e6a24781c3a75f8d1d304d /indra/llcommon/llerror.h
parent5c9d60c0e58e2dc65e3e048bd42412997770c6d6 (diff)
Introduce owning_ptr<T>; use it for JPEG2KEncode and JPEG2KDecode.
owning_ptr<T> adapts std::unique_ptr<T> to be a better drop-in replacement for a legacy class that formerly stored plain T* data members, and explicitly destroyed them using domain-specific destructor functions. Directly substituting std::unique_ptr into JPEG2KEncode and JPEG2KDecode was cumbersome because every such pointer declaration required a redundant template parameter describing the deleter function passed into its constructor. Moreover, it required lots of little syntax tweaks: changing every assignment to a reset() call, changing every reference to a get() call. Using owning_ptr<T> allows us to leave the code more or less as it was before, save that assignment and destruction automatically handle the previous referenced T instance.
Diffstat (limited to 'indra/llcommon/llerror.h')
0 files changed, 0 insertions, 0 deletions