Clang-Format report examples
Let’s prepare a simple example to demonstrate the Clang-Format tool in action. We will create a basic C++ source file named main.cpp
with some formatting issues. Then, we will run Clang-Format on this file to automatically correct the formatting and generate a report of the changes made:
#include <iostream> class Sender { public: void send(const std::string& message) { std::cout << “Sending: “ << message << std::endl; } }; class Receiver { public: void receive(const std::string& message) { std::cout << “Receiving: “ << message << std::endl; } }; class Mediator { public: Mediator(Sender sender, Receiver receiver) ...