use c++ magic