Deduction of the function

No, you (currently) cannot. The standard way of doing this is by creating “make_like” function (such as make_pair, make_optional …): template<typename F, typename… Args> A<std::decay_t<F>> make_A (F &&f, Args&&… args) { return {std::forward<F>(f), std::forward<Args>(args)…}; } C++17 will introduce template argument deduction for class which will allow you to do exactly what you want (see also … Read more

Remove reference in decltype (return T instead of T& where T& is the decltype)

To remove a reference: #include <type_traits> static_assert(std::is_same<int, std::remove_reference<int&>::type>::value, “wat”); In your case: template <typename T> auto doSomething(const T& foo) -> typename std::remove_reference<decltype(foo.bar())>::type { return foo.bar(); } Just to be clear, note that as written returning a reference is just fine: #include <type_traits> struct f { int& bar() const { static int i = 0; return … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)