-
Notifications
You must be signed in to change notification settings - Fork 6
Closed
Cantera/cantera
#1568Labels
work-in-progressAn enhancement that someone is currently working onAn enhancement that someone is currently working on
Description
Abstract
A major version step from 2.6 to 3.0 could be used to remove some legacy typedef's where using standard types would clarify what those types are (after introducing using std::vector;, savings of length are mostly marginal)
-
typedef vector<vector<size_t>> grouplist_t(unused) ... Standardize code cantera#1565 -
typedef vector<int> vector_int(60 instances) ... Standardize code cont'd cantera#1568 -
typedef vector<double> vector_fp(1400 instances) ... Standardize code cont'd cantera#1568 -
typedef double doublereal(4426 instances, longer than necessary; use has been discouraged for some time) ... Standardize code cont'd cantera#1568
There are two different 'compositions', which are identical (one typedef is worth keeping in this instance):
-
typedef map<string, double> compositionMap(84 instances) ... Standardize code cantera#1565 -
typedef map<string, double> Composition(79 instances) ... Standardize code cantera#1565
It would also be possible to eliminate std:: in many instances (due to newly introduced using std::xyz:
-
std::make_shared(1 remaining instance) ... Standardize code cont'd cantera#1568 -
std::set(11 instances) ... Standardize code cantera#1565 -
std::shared_ptr(20 instances) ... Standardize code cont'd cantera#1568 -
std::unique_ptr(25 instances) ... Standardize code cont'd cantera#1568 -
std::pair(37 instances) ... Standardize code cont'd cantera#1568 -
std::function(81 instances) ... Standardize code cont'd cantera#1568 -
std::map(121 instances) ... Standardize code cont'd cantera#1568 -
std::vector(461 instances) ... Standardize code cont'd cantera#1568 -
std::string(1619 instances) ... Standardize code cont'd cantera#1568
Motivation
Improve readability of code (and Doxygen documentation):
- using standard types where applicable ensures that new users understand what types are being used
- new features oftentimes leverage existing code, where copy/paste of outdated syntax perpetuates issues, leading to unnecessary review feedback (if caught)
- shorten function signatures (if
std::is omitted where possible)
Possible Solutions
Simple find/replace in *.h/*.cpp files.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
work-in-progressAn enhancement that someone is currently working onAn enhancement that someone is currently working on