attribute.hpp 446 B

123456789101112131415161718192021
  1. #if defined(Hiro_Attribute)
  2. struct Attribute {
  3. using type = Attribute;
  4. Attribute(const string& name, const any& value = {});
  5. auto operator==(const Attribute& source) const -> bool;
  6. auto operator< (const Attribute& source) const -> bool;
  7. auto name() const -> string;
  8. auto setValue(const any& value = {}) -> type&;
  9. auto value() const -> any&;
  10. private:
  11. struct State {
  12. string name;
  13. mutable any value;
  14. } state;
  15. };
  16. #endif