C++ template string concatenation

后端 未结 5 893
天涯浪人
天涯浪人 2020-12-16 02:50

I\'m trying to define some variadic template like that:

typedef const char CCTYPE[];
template struct StringConcat { ... };
         


        
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 02:56

    You cannot concatenate two or more string literals expecting to get a single string literal (unless you want to use macros). But depending on the task at hand you can your template function return, for example, a std::string, which is a concatenation of string literals. The latter is trivial.

提交回复
热议问题