mirror of
https://github.com/pybind/pybind11.git
synced 2026-04-20 06:49:25 +00:00
fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052)
* Enable and apply clang-tidy readability and misc fixes. * Revert deprecated tester * add space to tests/test_constants_and_functions.cpp
This commit is contained in:
@@ -34,7 +34,7 @@ void noisy_funct_dual(std::string msg, std::string emsg) {
|
||||
// simply repeatedly write to std::cerr until stopped
|
||||
// redirect is called at some point to test the safety of scoped_estream_redirect
|
||||
struct TestThread {
|
||||
TestThread() : t_{nullptr}, stop_{false} {
|
||||
TestThread() : stop_{false} {
|
||||
auto thread_f = [this] {
|
||||
while (!stop_) {
|
||||
std::cout << "x" << std::flush;
|
||||
@@ -49,7 +49,7 @@ struct TestThread {
|
||||
|
||||
void stop() { stop_ = true; }
|
||||
|
||||
void join() {
|
||||
void join() const {
|
||||
py::gil_scoped_release gil_lock;
|
||||
t_->join();
|
||||
}
|
||||
@@ -59,7 +59,7 @@ struct TestThread {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
}
|
||||
|
||||
std::thread * t_;
|
||||
std::thread *t_{nullptr};
|
||||
std::atomic<bool> stop_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user