C++Now 2016 has ended
Please visit the C++Now website.
Back To Schedule
Thursday, May 12 • 4:30pm - 5:15pm
Preprocessor-aware Automated Refactoring

Log in to save this to your schedule, view media, leave feedback and see who's attending!

The arrival of C++11/14 and the emergence of sophisticated refactoring tools based on Clang have generated a lot of interest in using automated methods to update code to modern coding styles. One stumbling block has been the widespread use of preprocessor constructs to implement older idioms. Clang-based tools "see" the source AST after it has been preprocessed and then parsed, so they have a limited ability to refactor preprocessor-based (or interacting) idioms. Fortunately, we have some tools available that focus on the preprocessor step. The Boost.Wave library, introduced in 1.33, provides both a fully functional preprocessor and hooks for modifying generated output, or performing other actions, as it runs. Clang provides similar functionality with the pp-trace tool and PPCallbacks interface. The presenter will give an introduction to these two preprocessor tools and then demonstrate how each can be leveraged, in concert with Clang's AST rewriter, to modernize some popular preprocessor-based code idioms.

avatar for Jeff Trull

Jeff Trull

Principal, Trull Consulting
Electronic CAD algorithmsModern C++ design patterns

Thursday May 12, 2016 4:30pm - 5:15pm MDT
Booz Allen Hamilton