I use preprocessor macros for what I guess I'll call "hyper-local extraction" in an attempt to be as DRY as possible. I don't know how modern C++ would handle this better. It looks a bit like this:
#define a_ frob(-1,0,0); grob("a"); blah(...);
#define b_ frob(1,0,0); grob("b"); blah(...);
#define c_ frob(0,-1,0); grob("c"); blah(...);
#define d_ frob(0,-1,1); grob("d"); blah(...);
#define e_ frob(0,0,-1); grob("e"); blah(...);
#define f_ frob(0,1,1); grob("f"); blah(...);
if (normal_order) {
a_ b_ c_ d_ e_ f_;
c_ b_ a_ f_ e_ d_;
} else if (special_order_1) {
b_ c_ d_ e_ a_;
d_ e_ c_ b_ a_ f_;
} else if (...) {
// ... and so on ...
}
#undef a_
#undef b_
#undef c_
#undef d_
#undef e_
#undef f_