//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. 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); }