Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aliases for classes used by clients to reduce templating clutter #172

Open
AmroAlJundi opened this issue Sep 24, 2022 · 0 comments
Open
Labels
state: inactive Issue is abandoned, but might become relavent at some point type: feature Brand new functionality, features, workflows, endpoints, etc

Comments

@AmroAlJundi
Copy link
Contributor

AmroAlJundi commented Sep 24, 2022

SparseBase is highly templated to allow users maximum freedom when defining their objects. However, with all this templating, code starts becoming cluttered and hard to understand. For this reason, we will define new aliases for client-facing classes and functions in which templated arguments are part of the alias name. For example, instead of the code in Snippet A below, the user can use Snippet B:

// Snippet A: non-aliased code is cluttered
CSR<unsigned int, unsigned int, unsigned int> csr;

// Snippet B: aliased code gets rid of the clutter
CSR_iii csr;

In the current model of using the library, the only part of the API that the client will have to use is a) functions in Bases and b) Format classes. The former category, with the exception of IOBase, does not require template arguments as they are deduced from the input. The latter category requires explicit template arguments. Therefore, we will add aliases for Format classes and IOBase functions only.

Google's C++ Style Guide has some details on good aliasing behavior.

@AmroAlJundi AmroAlJundi added state: inactive Issue is abandoned, but might become relavent at some point type: feature Brand new functionality, features, workflows, endpoints, etc labels Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: inactive Issue is abandoned, but might become relavent at some point type: feature Brand new functionality, features, workflows, endpoints, etc
Projects
None yet
Development

No branches or pull requests

1 participant