Closed ischoegl closed 11 months ago
I'd say that making these changes has very little to do with the 3.0 version change, assuming we leave the old typedefs available but marked as deprecated. However, this might be as good an opportunity as we're going to get in terms of having relatively few major PRs open (or large pre-PR projects that I'm aware of) that will require significant manual conflict resolution to rebase them.
One somewhat related change that had been on my mind, in that it would touch a lot of the same lines of code, is making full use of the C++11 override
specifier, and removing the virtual
keyword from overrides (i.e., virtual
should only appear on the base class declaration of a method). Currently, we only do this for a handful of classes that are either recent additions or have had major recent changes.
Ok. From my perspective, these are changes that are easily implemented but somewhat of a pain to review, which is the reason I was asking. I'm :+1: with moving forward, although I'd like to resolve the virtual
in a different enhancement/PR (which I'd be happy to review). If you're ok as well, I'll wait until the current slew of PR's is merged, and start ticking the items off thereafter.
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) ... Cantera/cantera#1565typedef vector<int> vector_int
(60 instances) ... Cantera/cantera#1568typedef vector<double> vector_fp
(1400 instances) ... Cantera/cantera#1568typedef double doublereal
(4426 instances, longer than necessary; use has been discouraged for some time) ... Cantera/cantera#1568There are two different 'compositions', which are identical (one typedef is worth keeping in this instance):
typedef map<string, double> compositionMap
(84 instances) ... Cantera/cantera#1565typedef map<string, double> Composition
(79 instances) ... Cantera/cantera#1565It would also be possible to eliminate
std::
in many instances (due to newly introducedusing std::xyz
:std::make_shared
(1 remaining instance) ... Cantera/cantera#1568std::set
(11 instances) ... Cantera/cantera#1565std::shared_ptr
(20 instances) ... Cantera/cantera#1568std::unique_ptr
(25 instances) ... Cantera/cantera#1568std::pair
(37 instances) ... Cantera/cantera#1568std::function
(81 instances) ... Cantera/cantera#1568std::map
(121 instances) ... Cantera/cantera#1568std::vector
(461 instances) ... Cantera/cantera#1568std::string
(1619 instances) ... Cantera/cantera#1568Motivation
Improve readability of code (and Doxygen documentation):
std::
is omitted where possible)Possible Solutions
Simple find/replace in
*.h
/*.cpp
files.