static_cast3.c

来自「this is a gcc file, you can download it 」· C语言 代码 · 共 25 行

C
25
字号
template <class T> struct static_abort {};template <class E>struct any{  const E& self() const { return static_cast<const E&>(*this); }};struct range : public any<range>{  range() {}  template <class U>  range(const U&)  {    typedef typename static_abort<U>::ret t;  }};int main(){  const any<range>& r = *new range();  r.self();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?