2 /* Copyright 2002, The libsigc++ Development Team
3 * Assigned to public domain. Use as you wish without restriction.
6 #include "testutilities.h"
9 #include <sigc++/sigc++.h>
13 std::ostringstream result_stream;
18 result_stream << "unknown";
24 result_stream << "int";
28 void bar<double>(double)
30 result_stream << "double";
33 struct foo : public sigc::functor_base
35 typedef double result_type;
37 int operator()(int i = 1);
38 double operator()(const int&, int);
41 struct foo2 : public foo
44 struct foo3 : public sigc::functor_base
46 typedef int result_type;
48 int operator()(int i = 1);
49 double operator()(const int&, int);
52 } // end anonymous namespace
54 int main(int argc, char* argv[])
56 auto util = TestUtilities::get_instance();
58 if (!util->check_command_args(argc, argv))
59 return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;
61 bar(sigc::deduce_result_t<foo2, long>());
62 util->check_result(result_stream, "double");
64 bar(sigc::deduce_result_t<foo2, int, int>());
65 util->check_result(result_stream, "double");
67 bar(sigc::deduce_result_t<foo3, int, int>());
68 util->check_result(result_stream, "int");
71 bar(sigc::deduce_result_t<foo2, int, int, int>());
72 util->check_result(result_stream, "double");
75 return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;