Lines Matching refs:From
23 // The From type can be inferred, so the preferred syntax for using
31 template<typename To, typename From>
32 inline To implicit_cast(From const &f) {
55 template<typename To, typename From> // use like this: down_cast<T*>(foo);
56 inline To down_cast(From* f) { // so we only accept pointers
57 // Ensures that To is a sub-type of From *. This test is here only
62 implicit_cast<From*, To>(0);
76 // compiler will just bind From to const T.
77 template<typename To, typename From>
78 inline To down_cast(From& f) {
82 // Compile-time check that To inherits from From. See above for details.
83 implicit_cast<From*, ToAsPointer>(0);