#include <type_traits>
#include <iostream>
int main() {
auto f = []() { return; };
auto g = []() { returntrue; };
std::cout << "f: " << std::is_same<bool, decltype(f())>::value << '\n'; // false
std::cout << "g: " << std::is_same<bool, decltype(g())> ::value << '\n'; // true
}
Note that decltype(f) or decltype(g) won't return the type you think. It will return the type of the f or g lambda - nor the return type of the lambda.
You cannot determine the return type of all Callable or indeed even all FunctionObjects, without a choice of arguments used to invoke them. Therefore, let's step back a bit.
Why do you think you need this information? What problem are you trying to solve?
In my mind, a beginner would be focused more on control structures, function calls, organizing data into classes, projects with multiple files, using std::vector rather than arrays, etc. Your topics might overwhelm a true beginner.
I still feel a beginner :P.
You're not. We all feel we have much to learn, but your questions belie your experience.