1 template <class T> struct static_abort {}; 2 3 template <class E> 4 struct any 5 { selfany6 const E& self() const { return static_cast<const E&>(*this); } 7 }; 8 9 struct range : public any<range> 10 { rangerange11 range() {} 12 13 template <class U> rangerange14 range(const U&) 15 { 16 typedef typename static_abort<U>::ret t; 17 } 18 }; 19 main()20int main() 21 { 22 const any<range>& r = *new range(); 23 r.self(); 24 } 25