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

Remove all standard library aliases #953

Closed
ken-matsui opened this issue Jul 21, 2024 · 0 comments · Fixed by #962
Closed

Remove all standard library aliases #953

ken-matsui opened this issue Jul 21, 2024 · 0 comments · Fixed by #962
Labels
good first issue Good for newcomers

Comments

@ken-matsui
Copy link
Member

ken-matsui commented Jul 21, 2024

Remove all standard library aliases from src/Rustify/Aliases.hpp. We also want to remove headers from this file, and add headers to files that previously depended on those aliases accordingly. This may improve the compilation performance, but the main purpose for this is to simplify code writing.

template <typename T, usize N>
using Arr = std::array<T, N>;
template <typename T>
using Vec = std::vector<T>;
template <typename K, typename V>
using HashMap = std::unordered_map<K, V>;
template <typename K>
using HashSet = std::unordered_set<K>;
template <typename T>
using Option = std::optional<T>;
struct NoneT : protected std::monostate {
constexpr bool operator==(const usize rhs) const {
return std::string_view::npos == rhs;
}
// NOLINTNEXTLINE(google-explicit-constructor)
constexpr operator std::nullopt_t() const {
return std::nullopt;
}
template <typename T>
constexpr operator Option<T>() const { // NOLINT(google-explicit-constructor)
return std::nullopt;
}
};
inline constinit const NoneT None; // NOLINT(readability-identifier-naming)
inline std::ostream&
operator<<(std::ostream& os, const NoneT& /*unused*/) {
return os << "None";
}

Here are some relevant PRs:

@ken-matsui ken-matsui added the good first issue Good for newcomers label Jul 21, 2024
ken-matsui added a commit that referenced this issue Jul 21, 2024
ken-matsui added a commit that referenced this issue Jul 23, 2024
ken-matsui added a commit that referenced this issue Jul 23, 2024
ken-matsui added a commit that referenced this issue Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant