Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Templates: dealing with long class names [closed]

Tags:

c++

c++11

If using statements are barred from headers in CPP projects according to nearly everyone, and templates must be declared in the headers unless specific steps are taken to specifically list out the classes that will be accepted in the cpp file,

What is the manner in which the following header template declaration should be rendered readable:

template<class A>
SomeLibrary::LongNameClass<SomeLibrary::LongNameClass2,SomeLibrary::LongNameClass3>
unreadable_function(SomeLibrary::LongNameClass<SomeLibrary::...> input1, ... input2, ... omg){
        SomeLibrary::SomeFunction<SomeLibrary::LongNameClass<SomeLibrary::...
        etc.
}
like image 574
Chris Avatar asked Sep 02 '25 06:09

Chris


1 Answers

Dont be mistaken, the only banned statement is using namespace <...>.

The statement using <alias> = <type> as well as typedef <type> <alias> are still valid and widely used.

like image 58
Semyon Burov Avatar answered Sep 04 '25 20:09

Semyon Burov