Trying to push_back on a list. C++
<p>I am getting a compiler error when I am trying to use the push_back method on my list.</p>

<p>Here is my code:</p>

<pre><code>// Point iterator to the proper warehouse.
set&lt;cs3505::warehouse&gt;::iterator curr_warehouse = warehouses.find(warehouse);

// Insert new inventory_item into the warehouse.

// Create a copy of today's date, and increment it.
cs3505::date exp_date = current_date;
exp_date.increment(curr_food.get_shelf_life());

// Create a new inventory item.
cs3505::inventory_item new_item(curr_food, exp_date);
// Set the quantity of the new item.
new_item.set_quantity(qty);

// Now insert the item.
// Adding new items being at the end ensures the oldest items will be at the 
// beginning of the list.
(*curr_warehouse).inventory.push_back(new_item);
</code></pre>

<p>Compiler error:</p>

<blockquote>
  <p>report.cc:134: error: passing ‘const std::list >’ as ‘this’ argument of ‘void std::list&lt;_Tp, _Alloc>::push_back(const _Tp&amp;) [with _Tp = cs3505::inventory_item, _Alloc = std::allocator]’ discards qualifiers</p>
</blockquote>

<p>The last line of my code is line 134. Thanks for any help. I've been banging my head on this for a few hours.</p>

<p>This is the definition for an inventory_item:</p>

<pre><code>/*
 * An inventory item which includes a food item, an expiration date,
 * and quantity.
 */

#include "inventory_item.h"
#include "date.h"
#include "food_item.h"

namespace cs3505
{
// inventory_item definitions

/*
 * Constructs an inventory item.
 */
inventory_item::inventory_item(food_item &amp;item, date &amp;exp_date)
{
    this-&gt;item = item;
    this-&gt;expiration_date = exp_date;
    this-&gt;quantity = 0;
}

/*
 * Destructs a food item.
 */
inventory_item::~inventory_item() { }

/*
 * Returns this inventory item's food item.
 */
food_item inventory_item::get_food_item()
{
    return this-&gt;item;
}

/*
 * Returns the expiration date for this inventory item.
 */
date inventory_item::get_exp_date()
{
    return this-&gt;expiration_date;
}

/*
 * Returns the quantity of this inventory item.
 */
int inventory_item::get_quantity()
{
    return this-&gt;quantity;
}

/*
 * Sets the quantity of this food item.
 */
void inventory_item::set_quantity(int change)
{
    this-&gt;quantity = change;
}
}
</code></pre>

<p>I also have a custom warehouse class that has a list. I'm trying to add an inventory item to that list.</p>
