ゲーム作りは楽しい

なんか書く

2020-12-13から1日間の記事一覧

C++でC#のasみたいな書き方する遊び(糞)

template<class T> struct as_op {}; template<class T> constexpr as_op<T> as_obj{}; template<class T, class U> auto operator | (T* ptr, const as_op<U>& op) { return dynamic_cast<U*>(ptr); } #define as | as_obj struct Super{virtual ~Super()=default;}; struct A : Super{ }; int main() { Su</u*></u></class></t></class></class>…