Aspect-oriented programming (AOP) is a way of implementing new class features without changing class code. For example for adding logging to selected classes. It implements code separation in different way than in other paradigms like OOP.
There is a hard way of doing this - with help of pre-compiler like AspectC++.
There are several other ways (workarounds) for implementing it in standard C++:
- Curiously Recurring Template (see links below)
- Execute-Around Pointer
- policy-based design (which is similar, but not the same as aspects), see Template metaprogramming which allows you to implement zero-cost optional method parts
Aspects - articles
- Curiously Recursive Template Problems with Aspect Oriented Programming - Hugo Arregui, Carlos Castro and Daniel Gutson, 2012
- Aspect-Oriented Programming & C++ - Christopher Diggins, 2004 - shows how you can simply implement aspects
- "AOP++: A Generic Aspect-Oriented Programming Framework in C++" - Zhen Yao, Qi-long Zheng, Guo-liang Chen
- "ACRE: An Automated Aspect Creator for Testing C++ Applications" - Etienne Duclos, Yann-Gaël Guéhéneuc, and Sébastien Le Digabel
- Aspect Oriented Programming in C++ - Dominik Jürgens (in German)
Aspects - solutions
- Aspect-Oriented Programming with C++ and AspectC++ - Daniel Lohmann, Olaf Spinczyk, 2007