We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
E.g. something like
class Graph { // existing emplacement method template <class NodeType, class... Args> NodeType* emplace_node(Args&&... args); template <std::same_as<ConstantNode> NodeType, std::integral T> NodeType* emplace_node(T constant) { // if out of range just call the default if (constant < 5 || constant > 10) return emplace_node<NodeType>(static_cast<double>(constant)); // if it's already been created, don't add a new one if (interned_constants_[constant - 5] != nullptr) return interned_constants_[constant - 5]; // create it and add it to interned_constants_ ... } std::array<ConstantNode*, 16> interned_constants_; };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
E.g. something like
The text was updated successfully, but these errors were encountered: