-
-
Notifications
You must be signed in to change notification settings - Fork 1
General refactors. #4
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Fields
Give feedbackNo fields configured for issues without a type.
Making a list of various changes to make this code more up-to-date. Most of these are easy on their own. It will just take time to do them all. I've already finished most of these kinds of changes to Umbra.
TCODListshould be replaced withstd::vectorin all cases.new/deletefrom libtcod types. These can be treated as values without major issues. Any exceptions can use smart pointers instead ofnew.std::unique_ptr, but alsostd::shared_ptrif necessary. Non-owning pointers would still be raw of course.{};at the end of simple types rather than= nullptr;or= 0;. Any defaults should be moved from the class constructor code to the class itself.std::stringin many cases. Mostly in non-contexpr cases such as class attributes or local variables. In some cases null strings should be replaced with empty strings. Always replacestrdup.#define X Yconstants should generally be replaced withstatic constexpr auto X{Y};/static constexpr auto X = Y;constants.#definemacros should all be replaced withconstexprfunctions.memcpyandstrcmpshould generally be replaced with high level operations.int foo[2]should be replaced withstd::array<int, 2> foo{}, etc.<filesystem>.for (auto& x : y);const,noexecpt, and[[nodiscard]]qualifiers.= default;, they should not have an empty function in the source.MINorCLAMPshould be replaced by their C++ functions.overridequalifier.fmt.const.std::variant.In general follow the C++ Core Guidelines.