1 // Copyright (C) 2006 Arkadiy Vertleyb 2 // Use, modification and distribution is subject to the Boost Software 3 // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) 4 5 #include <boost/typeof/typeof.hpp> 6 #include <boost/type_traits/is_same.hpp> 7 #include <boost/static_assert.hpp> 8 f1()9void f1() {} f2(...)10void f2(...) {} 11 12 template<class T> 13 struct tpl1 14 { 15 typedef BOOST_TYPEOF_TPL(&f1) type; 16 }; 17 18 template<class T> 19 struct tpl2 20 { 21 typedef BOOST_TYPEOF_TPL(&f2) type; 22 }; 23 24 typedef void(*fun1_type)(); 25 typedef void(*fun2_type)(...); 26 27 BOOST_STATIC_ASSERT((boost::is_same<tpl1<void>::type, fun1_type>::value)); 28 BOOST_STATIC_ASSERT((boost::is_same<tpl2<void>::type, fun2_type>::value)); 29