Skip to content

Commit

Permalink
Work around vector<bool> + fmt incompatibility with libc++
Browse files Browse the repository at this point in the history
I don't understand why fmt deletes the vector<bool> formatter with
libc++ but not with libstdc++. But at least get it to compile for now.
  • Loading branch information
mattkretz authored and RalphSteinhagen committed Jul 20, 2023
1 parent 43f0c53 commit 97e20a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/thread_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,13 @@ class BasicThreadPool {
[[nodiscard]] std::future<R> execute(Callable &&func, Args &&...funcArgs) {
if constexpr (cpuID >= 0) {
if (cpuID >= _affinityMask.size() || (cpuID >= 0 && !_affinityMask[cpuID])) {
#ifdef _LIBCPP_VERSION
throw std::invalid_argument(fmt::format("cpuID {} is out of range [0,{}] or incompatible with set affinity mask",
cpuID, _affinityMask.size()));
#else
throw std::invalid_argument(fmt::format("cpuID {} is out of range [0,{}] or incompatible with set affinity mask [{}]",
cpuID, _affinityMask.size(), _affinityMask));
#endif
}
}
std::promise<R> promise;
Expand Down

0 comments on commit 97e20a7

Please sign in to comment.