12345678910111213141516171819202122232425262728293031323334 |
- /*
- * Simple test file for cxxomfort
- *
- * This and other examples assume cxxomfort is installed in
- * include library path; if otherwise, compile with
- * -I /path/to/cxxomfort .
- */
- #define CXXOMFORT_NOTICES 1
- #include <cxxomfort/backports.hpp>
- #include <cxxomfort/library/functional.hpp>
- #include <cxxomfort/library/type_name.hpp>
- #include <iostream>
- #include <cmath>
- #include <cstdlib>
- #include <ctime>
- int f(int) { return 1; }
- int f(std::tm) { return 2; }
- int main () {
- using namespace std;
- namespace cxl= cxxomfort::library;
- cxxomfort::output_info();
- cout<< cxl::typeid_demangle( typeid(
- ptr_fun(labs)
- ))<< endl;
-
- tm t;
- cxl::functional::functiontype<int(struct tm)>::pointer F = f; // should pick f(double)
- cout<< "expect: 2. get: "<< F(t)<< endl;
-
- }
|