23 lines · plain
1.. title:: clang-tidy - abseil-cleanup-ctad2 3abseil-cleanup-ctad4===================5 6Suggests switching the initialization pattern of ``absl::Cleanup``7instances from the factory function to class template argument8deduction (CTAD), in C++17 and higher.9 10.. code-block:: c++11 12 auto c1 = absl::MakeCleanup([] {});13 14 const auto c2 = absl::MakeCleanup(std::function<void()>([] {}));15 16becomes17 18.. code-block:: c++19 20 absl::Cleanup c1 = [] {};21 22 const absl::Cleanup c2 = std::function<void()>([] {});23