[LLVMdev] ErrorOr<> conflicts with unique_ptr<>

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Nov 26 08:29:19 PST 2013


> I disagree that "the cool transparency disappears". unique_ptr<T> models a
> pointer to T (by exposing op*/op-> to access the underlying object),
> ErroOr<T> models a pointer to T (by exposing op*/op-> to access the
> underlying object). So ErrorOr<unique_ptr<T>> models a pointer to pointer to
> T and thus requires two dereferences.

IMHO ErrorOr should just not model a pointer. I mean, it is T or an
error, not a pointer to T. I started a patch for it but got
sidetracked into the Mangler. I will hopefully have time to get back
to it this week.

Cheers,
Rafael



More information about the llvm-dev mailing list