You can define a function alias (with some work) using perfect forwarding:
template <typename... Args>
auto g(Args&&... args) -> decltype(f(std::forward<Args>(args)...)) {
return f(std::forward<Args>(args)...);
}
This solution does apply even if f
is overloaded and/or a function template.
More Related Contents:
- Proper way to create unique_ptr that holds an allocated array
- Forcing or preventing use of a particular minor version of libstdc++
- _GLIBCXX_USE_CXX11_ABI, GCC 4.8 and ABI compatibility
- Undefined reference to process(std::__cxx11::basic_string … ) when compiling affdex linux sample applications
- How to assert if a std::mutex is locked?
- Implementation C++14 make_integer_sequence
- Is cout synchronized/thread-safe?
- How does #include work in C++? [duplicate]
- What are the GCC default include directories?
- Is it a conforming compiler extension to treat non-constexpr standard library functions as constexpr?
- C++11 aggregate initialization for classes with non-static member initializers
- constexpr and initialization of a static const void pointer with reinterpret cast, which compiler is right?
- Does MinGW-w64 support std::thread out of the box when using the Win32 threading model?
- Can I use C++11 with Xcode?
- Compilation fails with “relocation R_X86_64_32 against `.rodata.str1.8′ can not be used when making a shared object”
- 😃 (and other Unicode characters) in identifiers not allowed by g++
- Linking libstdc++ statically: any gotchas?
- When is it necessary to use the flag -stdlib=libstdc++?
- Is this C++11 regex error me or the compiler?
- C++ new operator thread safety in linux and gcc 4
- What are the differences between -std=c++11 and -std=gnu++11?
- Linking g++ 4.8 to libstdc++
- Cross Platform Floating Point Consistency
- Is there a compiler bug exposed by my implementation of an is_complete type trait?
- How to update GCC in MinGW on Windows?
- Why can I call a non-constexpr function inside a constexpr function?
- gcc can compile a variadic template while clang cannot
- version `CXXABI_1.3.8′ not found (required by …) [duplicate]
- “to_string” isn’t a member of “std”?
- GCC std::thread not found in namespace std