MCPcopy Create free account
hub / github.com/Extra-Creativity/Modern-Cpp-Basics / main

Function main

12-Advanced Template/Answer-code/Invoke.cpp:138–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136}
137
138int main()
139{
140 std::println("----Normal function test----");
141 std::println("Hi, {}", Invoke(Test, 1));
142 std::println("----Normal function pointer test----");
143 std::println("Hi, {}", Invoke(Test, 1));
144
145 B b1;
146 std::println("----Normal functor test----");
147 std::println("Hi, {}", Invoke(b1, 1));
148 std::println("Hi, {}", Invoke(B{}, 2));
149
150 const B b2;
151 std::println("----Const functor test----");
152 std::println("Hi, {}", Invoke(b2, 3));
153
154 std::println("Non-const object member pointer test: ", Invoke(Test, 1));
155 A a1;
156 ObjectTest(a1);
157
158 std::println("Const object member pointer test: ", Invoke(Test, 1));
159 const A a2;
160 ObjectTest(a2);
161
162 return 0;
163}

Callers

nothing calls this directly

Calls 2

ObjectTestFunction · 0.85
InvokeFunction · 0.70

Tested by

no test coverage detected