probinson added a comment.

Ah, hadn't considered statefulness.  But if you layer another class on top of 
DataExtractor to handle the error flag, it would have to be replicating all the 
offset-is-valid checks, because of course DataExtractor itself doesn't return 
errors.

I have a couple more ideas to toss out there...

- A DataExtractorBase class that returns Optional<whatever>, and then 
DataExtractor layers on top and converts None to zero, which preserves the 
non-statefulness as well as the current API. This adds some runtime overhead, 
not sure how much.
- Or, a template DataExtractorBase that takes an error-handling class as a 
parameter (sort of like how STL containers take an allocator) and a 
DataExtractor specialization uses a no-op error-handling class. Should avoid 
runtime overhead at the cost of template cruft.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63591/new/

https://reviews.llvm.org/D63591



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to