myTrait = MyTrait::ifImbued(traitsData), allowing for a workflow of if myTrait := MyTrait.makeIfImbued(traitsData): ... (Python) / if (myTrait = MyTrait::makeIfImbued(traitsData)) { ... (C++). This works since shared_ptr with a nullptr is falsey in C++ and None in Python.
What
Migrated from https://github.com/OpenAssetIO/OpenAssetIO/issues/816 since we're planning to get rid of
TraitBase
myTrait = MyTrait::ifImbued(traitsData)
, allowing for a workflow ofif myTrait := MyTrait.makeIfImbued(traitsData): ...
(Python) /if (myTrait = MyTrait::makeIfImbued(traitsData)) { ...
(C++). This works sinceshared_ptr
with anullptr
is falsey in C++ andNone
in Python.