Yes this 100% possible, it does not matter if you use GNS3, CML or a real network. C++ is not only possible but can be highly effective for sophisticated networking solutions. C++ provides great robust capabilities for network automation projects through libraries and low-level socket programming techniques.
I have seen people use tools like Boost.Asio, libcurl, and OpenSSL to create complex network automation scripts and applications that offer high performance and also very precise control. From what I have seen these libraries enable advanced functionalities such as network device communication, configuration management, protocol implementation, security scanning, and performance testing.
While C++ requires more intricate programming compared to scripting languages like Python, it does offers superior performance, direct hardware interaction, and a fine-grained memory management.
I heard great thing about this book https://www.amazon.com/Mastering-Network-Automation-Configuration-Orchestration/dp/8196228562
Good luck
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io