#pragma once #include #include #include // Define exported clone functions. namespace astclone { template T* clone(const T& tree) { Cloner clone; clone(tree); return dynamic_cast(clone.result_get()); } template void apply(applicable f, std::unique_ptr& t1) { A* t2 = f(*t1); t1.reset(t2); } template void apply(applicable_with_bools f, std::unique_ptr& t1, bool cond_1, bool cond_2) { A* t2 = f(*t1, cond_1, cond_2); t1.reset(t2); } template void apply(applicable_object f, std::unique_ptr& t1, B& t3) { A* t2 = f(*t1, t3); t1.reset(t2); } } // namespace astclone