Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class SavedLiteral
Note: This documentation is automatically generated.
When storing a reference to a literal, it is important not to forget when
reading it back to take its representative. Otherwise, we might introduce
literal that have already been removed, which will break invariants in a
bunch of places.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["The `SavedLiteral` class helps manage references to literals, ensuring data integrity during retrieval."],["When using a `SavedLiteral`, it's crucial to access its representative value using the `Get` method to avoid using removed literals."],["This approach prevents breaking invariants within the system by maintaining consistency between stored and accessed literals."]]],["The `SavedLiteral` class in C++ manages references to literals, ensuring consistency. Key actions include storing a literal's reference and retrieving its representative when reading it back. The documentation highlights the critical need to retrieve the representative, otherwise introducing removed literals can break invariants. The class provides methods: `Get` to retrieve the representative, and `SavedLiteral` constructors, one default and one that takes an integer `ref` argument.\n"]]