Content deleted Content added
Line 92:
=== C++ ===
In C++, a [[const-correctness|const-correct]] implementation of <code>Cart</code> would allow the user to
<syntaxhighlight lang="cpp">
class Cart {
public:
Cart(std::vector<Item>& items): items_
std::vector<Item>& items() { return items_; }
Line 105:
private:
std::vector<Item>& items_;
};
</syntaxhighlight>
|