MantisBT - Doomseeker
View Issue Details
0003813Doomseeker[All Projects] Cleanuppublic2020-06-07 05:022020-06-07 20:32
WubTheCaptain 
 
nonetweakhave not tried
confirmedopen 
1.3.1 
 
0003813: C style "typedef" is used instead of C++ style "using" keyword (C++11)
Another thing borrowed by C++98 from the C language (be it C89, C95 or C99): typedef keyword. Doomseeker uses C++, so I expect to not see C in the source codes (however compatible and not deprecated). Instead, the using keyword would be modern C++.
Introduced in C++11.
rep -r "typedef" src/ | less can be of interest. Excluding some LZMA dependencies, hand-filtered results:
src/plugins/chocolate-doom/chocolatedoomgameinfo.h:typedef enum
src/plugins/chocolate-doom/chocolatedoomgameinfo.h:typedef enum
src/core/gui/demomanager.cpp:   typedef QMap<int, Demo> DemoMap;
src/core/ip2c/ip2cparser.h:     typedef QHash<QString, QList<IP2C::IP2CData> > Countries;

src/core/ip2c/ip2cparser.h:     typedef QHash<QString, QList<IP2C::IP2CData> >::iterator 
CountriesIt;
src/core/ip2c/ip2cparser.h:     typedef QHash<QString, QList<IP2C::IP2CData> >::const_iterator 
CountriesConstIt;
src/core/refresher/refresher.cpp:       typedef QHash<MasterClient *, MasterClientInfo *> MasterHashtable;

src/core/refresher/refresher.cpp:       typedef QHash<MasterClient *, MasterClientInfo *>::iterator 
MasterHashtableIt;
src/core/serverapi/serverptr.h: * ServerPtr typedefs declarations.
src/core/serverapi/playerslist.h:typedef QMap<int, PlayersList> PlayersByTeams;

I hope I interpreted this right. (One is a comment line.)
'https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-using.html [^]'
'https://en.cppreference.com/w/cpp/language/type_alias [^]'
'https://stackoverflow.com/a/10748056 [^]'
No tags attached.
child of 0003803confirmed  C++11 support 
Issue History
2020-06-07 05:02WubTheCaptainNew Issue
2020-06-07 05:03WubTheCaptainRelationship addedchild of 0003803
2020-06-07 20:32Pol MNote Added: 0021386
2020-06-07 20:32Pol MStatusnew => confirmed

Notes
(0021386)
Pol M   
2020-06-07 20:32   
If the typedef is not part of a C file (whether it is *.c or a header *.h of a C library), using is better. The usual, do not change libraries etc :)