Skip to content

Commit

Permalink
Run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
samangh committed Aug 14, 2024
1 parent 4a853e1 commit 11976ab
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion benchmark/include/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ template <typename T, typename Rng = ankerl::nanobench::Rng>
}

template <std::ranges::range Seq, typename ValueType = std::ranges::range_value_t<Seq>>
requires std::is_integral_v<ValueType>
requires std::is_integral_v<ValueType>
void generate_random_data(Seq&& seq) {
static ankerl::nanobench::Rng rng(std::random_device{}());
std::uniform_int_distribution<ValueType> distribution(std::numeric_limits<ValueType>::min(),
Expand Down
2 changes: 1 addition & 1 deletion benchmark/source/matrix_multiplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "utilities.h"

template <std::integral DataType, typename FutureProvider>
requires std::invocable<FutureProvider, std::vector<DataType>, std::vector<DataType>>
requires std::invocable<FutureProvider, std::vector<DataType>, std::vector<DataType>>
void run_benchmark(ankerl::nanobench::Bench* bench, const std::size_t array_size,
const std::size_t multiplications_to_perform, const char* name,
FutureProvider&& provider) {
Expand Down
2 changes: 1 addition & 1 deletion examples/mandelbrot/include/fractal.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct rgb {

/// @brief Simple range class for viewing window and fractal window
template <class T>
requires std::integral<T> || std::floating_point<T>
requires std::integral<T> || std::floating_point<T>
struct fractal_window {
T x_min{};
T x_max{};
Expand Down
12 changes: 6 additions & 6 deletions include/thread_pool/thread_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ namespace dp {

template <typename FunctionType = details::default_function_type,
typename ThreadType = std::jthread>
requires std::invocable<FunctionType> &&
std::is_same_v<void, std::invoke_result_t<FunctionType>>
requires std::invocable<FunctionType> &&
std::is_same_v<void, std::invoke_result_t<FunctionType>>
class thread_pool {
public:
template <typename InitializationFunction = std::function<void(std::size_t)>>
requires std::invocable<InitializationFunction, std::size_t> &&
std::is_same_v<void, std::invoke_result_t<InitializationFunction, std::size_t>>
requires std::invocable<InitializationFunction, std::size_t> &&
std::is_same_v<void, std::invoke_result_t<InitializationFunction, std::size_t>>
explicit thread_pool(
const unsigned int &number_of_threads = std::thread::hardware_concurrency(),
InitializationFunction init = [](std::size_t) {})
Expand Down Expand Up @@ -139,7 +139,7 @@ namespace dp {
*/
template <typename Function, typename... Args,
typename ReturnType = std::invoke_result_t<Function &&, Args &&...>>
requires std::invocable<Function, Args...>
requires std::invocable<Function, Args...>
[[nodiscard]] std::future<ReturnType> enqueue(Function f, Args... args) {
#ifdef __cpp_lib_move_only_function
// we can do this in C++23 because we now have support for move only functions
Expand Down Expand Up @@ -204,7 +204,7 @@ namespace dp {
* @param args Arguments that will be passed to the function.
*/
template <typename Function, typename... Args>
requires std::invocable<Function, Args...>
requires std::invocable<Function, Args...>
void enqueue_detach(Function &&func, Args &&...args) {
enqueue_task(std::move([f = std::forward<Function>(func),
... largs =
Expand Down
2 changes: 1 addition & 1 deletion include/thread_pool/thread_safe_queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace dp {
};

template <typename T, typename Lock = std::mutex>
requires is_lockable<Lock>
requires is_lockable<Lock>
class thread_safe_queue {
public:
using value_type = T;
Expand Down

0 comments on commit 11976ab

Please sign in to comment.