//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // pointer_to_unary_function #include #include #include double unary_f(int i) {return 0.5 - i;} int main() { typedef std::pointer_to_unary_function F; static_assert((std::is_base_of, F>::value), ""); const F f(unary_f); assert(f(36) == -35.5); }