The latter is slightly more efficient and communicates the intent of the
API: writeFileAtomically does not own or copy the callback, it merely
calls it at some point.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 38130 Build 38129: arc lint + arc unit
Event Timeline
Comment Actions
Ah, the tests fail to compile because we now have an overload where the only difference is function_ref vs StringRef.
This works fine with std::function, STL probably ensures the conversions from StringRef to std::functtion fail and function_ref will only fail at constructor instantiation time.
I'll keep this open for now, will see if it's feasible to make function_ref similar to std::function in that case.