How to correctly pass a template parameter pack to another variadic template
The result of the following code I think should print “FUNC_TYPE::TYPE1 A&& “, but it doesn’t。And it reported an error。
Migrate away from std::unary _function with tricky signiture
I need to migrate an ancient codebase to support c++17. This means removing auto_ptr, unary_function etc. I’ve already removed several instances of unary_function successfully but this one is a puzzler.
How to use void for std::conditional_t in C++17
I try to define the std::function template arguments of a class member based on a std::conditional_t
type:
expand and fold parameter pack in specific way
#include <string> #include <string_view> template<typename… Args> std::string_view concatenateBuffer(std::string &buffer, Args &&… args){ static_assert((std::is_constructible_v<std::string_view, Args> && …)); buffer.clear(); (buffer.append(std::forward<Args>(args)), …); return buffer; } template<typename …Ts> std::string_view concat(std::string s, Ts …ts){ return concatenateBuffer(s , ((“,” , ts) , …) ); } #include <iostream> int main(){ std::string b; std::cout << concat(b, “a”) << ‘n’; std::cout << concat(b, “a”, […]
how to refer to typename’s typename is template in C++?
I am working on a project which is nested templates. How to refer to typename’s typename?
See examples below.