MCPcopy Create free account
hub / github.com/ceres-solver/ceres-solver / InvokeWithThreadId

Function InvokeWithThreadId

internal/ceres/parallel_invoke.h:46–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44// InvokeWithThreadId handles passing thread_id to the function
45template <typename F, typename... Args>
46void InvokeWithThreadId(int thread_id, F&& function, Args&&... args) {
47 constexpr bool kPassThreadId = std::is_invocable_v<F, int, Args...>;
48
49 if constexpr (kPassThreadId) {
50 function(thread_id, std::forward<Args>(args)...);
51 } else {
52 function(std::forward<Args>(args)...);
53 }
54}
55
56// InvokeOnSegment either runs a loop over segment indices or passes it to the
57// function

Callers 1

InvokeOnSegmentFunction · 0.85

Calls 1

functionFunction · 0.85

Tested by

no test coverage detected