Item API needs operator<<
Bug #907070 reported by
Paul J. Lucas
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
New
|
Low
|
Paul J. Lucas |
Bug Description
To emit the string value of an Item to an ostream, you currently have to use getStringValue() or getStringValue2(). This is inefficient since a string that is otherwise not needed needs to be created.
Instead, there should be a global operator<< defined:
std::ostream& operator<<( std::ostream&, store::Item const& );
Its implementation could simply call a new protected, pure virtual member function for Item:
virtual void emit( std::ostream& ) const = 0;
Related branches
Changed in zorba: | |
milestone: | none → 2.2 |
Changed in zorba: | |
importance: | Undecided → Low |
Changed in zorba: | |
status: | New → In Progress |
Changed in zorba: | |
milestone: | 2.2 → 2.5 |
Changed in zorba: | |
milestone: | 2.5 → none |
Changed in zorba: | |
status: | In Progress → New |
tags: | removed: item |
To post a comment you must log in.
I like the suggestion. However, the function should probably be called emitStringValue in order to make it clear what the exact semantics is.